How to create a 100% width table that shows scrollbars on itself rather than on the document
If I use a fixed width and overflow: auto then I can get scrollbars but I can't use the available width of the screen.
If I use no width then the table uses all available width but forces the document itself to have scrollbars when the browser window is too narrow.
How can I get the best of both worlds? Is there a non-javascript solution?
PS Did I mention this needs to work in IE6 too? :-)
To clarify: The table is 100% the width of it's contai开发者_JAVA技巧ner (in this case a table cell but don't worry - I've got an official permit) rather than 100% of the browser width. I want it to have fluid width and height but if the browser window is too narrow to contain it I want the table to have scrollbars rather than the document.
you can try using a div, with a height, and put the table inside that div. that div will have overflow: auto
.
精彩评论