Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

overflow:scroll; in <td>

Tags:

Why does the CSS property overflow:scroll; not work in <td>, while overflow:hidden; works well?

<table border="1" style="table-layout:fixed; width:100px">   <tr>     <td style="overflow:scroll; width:50px;">10000000000000000000000000000000000</td>     <td>200</td>     <td>300</td>   </tr> </table> 

From the CSS specs1,2, I can't see why.

like image 862
an0 Avatar asked Jul 31 '09 08:07

an0


2 Answers

You have to wrap it in a div, that will work:

<table border="1" style="table-layout:fixed; width:500px">   <tr>     <td style="width:100px;"><div style="overflow:scroll; width:100%">10000000000000000000000000000000000</div></td>     <td>200</td>     <td>300</td>   </tr> </table> 
like image 199
Tim Büthe Avatar answered Jan 04 '23 17:01

Tim Büthe


Firstly provide desired height to td and then Apply "float: left" property to respective "td" you want scrollbar to appear.

like image 33
user1885649 Avatar answered Jan 04 '23 16:01

user1885649