Setting overflow: scroll on a table with display: flex

前端 未结 2 1841
一整个雨季
一整个雨季 2021-01-06 23:54

I have a table with the display: flex property, whose cells will be centered vertically. When there are more cells than the table can show, the overflow:

2条回答
  •  有刺的猬
    2021-01-07 00:12

    Please visit - https://jsfiddle.net/3y80zqzc/1/

    You will observe newly added class for tbody. margin parameter is most important which ensures vertically middle position for the content.

    margin: auto, 0; /*this is for vertically middle position*/
    margin: 0, auto; /*this is for horizontally center position*/
    

    You may also look at the HTML code

    
    
    
    
    
    
    
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    A
    B
    C

提交回复
热议问题