Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set table td height and overflow scroll

I have a table and I want to display a vertical scrollbar on the td when its contents are exceeding a specified height of the row.

I have this sample code but it does not display active scrollbar on y axis no matter the content.

like image 391
Vassilis Barzokas Avatar asked Nov 30 '22 04:11

Vassilis Barzokas


1 Answers

Browsers won't apply overflow scrollbars to TD tags. You will need to enclose the content of your table cells in a div tag, and scroll that:

<td><div>Do you see what I meancxzdaaaaaaaaaaaaa?</div></td>

and:

td > div { overflow-y:scroll;overflow-x:hidden;} 
like image 131
Gareth Cornish Avatar answered Dec 04 '22 11:12

Gareth Cornish