Is there a css3 way to fix a on the y-axis, let it scroll on the x-axis?

前端 未结 2 1886
再見小時候
再見小時候 2021-01-13 13:33

This has been asked a zillion times: here, there, and the other place just on SO. Yet there\'s no real good answer that I can find.

Often I have tables

2条回答
  •  深忆病人
    2021-01-13 13:48

    a dirty way would be to put the header table in a separate div like:

    #v

    Then body in the another div like:

    1a
    1a
    1a
    1a
    1a

    Now you can give a fixed height to body div and set oveflow to auto. like:

    table{border:0px solid #ccc;height:30px;}
    table tr td{border:1px solid #ccc;padding:5px;}
    div.body{height:70px;overflow:auto;border-bottom:1px solid #ccc;}
    

    here is a working example I did in jsfiddle

提交回复
热议问题