I have a table, which is contained within a div with (overflow: scroll) set. The table has 3 columns which total to a width of 540px. The Div that the table is contained within is 500px, therefore I would like the div containing the table to scroll horizontally to show all of the table. The problem is that the table currently resizes all the columns in proportion to the size of the div to fit the available space. I would prefer them to stay set at the width I have ask them to be. So that they dont resize to fit. How do I do this? CSS style? table option? Thanks
I have done that, It doesnt work though which is why I am posting. I was wondering if there was a way to stop the columns from auto resizing to fit?
This code seems to work for me, but without looking at your code I can't really be sure if it applies to your problem: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <div style="width:500px;border:1px dashed #ccc;padding:1px;overflow: scroll;"> <table width="540px" style="background:#f1f1f1;"> <tr> <td>test</td> <td>test</td> <td>test</td> </tr> </table> </div> </body> </html> HTML: