Scrollable, fixed height table

http://jsfiddle.net/6zM9T/

I installed tbody on the following css:

tbody { height:200px; overflow:scroll; display:block; } 

Everything works, but the lines no longer use the full width. I tried adding width: 100%; but it did nothing. Any ideas?

+4
source share
2 answers

This limitation is - as far as I know - in the HTML specification. The problem is that if you have tbody with display: block, it no longer displays: table-row-group, which is necessary in order to be able to work in rows within rows. Ideally, they can overflow in this display mode, but where I find the limitation. The best option is to have an internal table.

0
source

Place the table in a div with a fixed height and overflow: auto;

0
source

Source: https://habr.com/ru/post/1434402/


All Articles