willem Posted May 3, 2006 Share Posted May 3, 2006 Hi,my first time here, fairly new at css, hope somebody can help me...I have a div in which i display a table as matrix, the div doesn't 'grow' with the matrix, (at least in IE6 it does, but not in FF or IE7 ftm). I was wondering wether it is possible to make the width of the div follow the document's width, as if yes, how?Proof Of Problem code: <html> <head> <style> .classfordiv { border: 1px solid black; } .classfortable { border: 1px solid red; white-space: nowrap; } </style> </head> <body> <div class="classfordiv"> <table class="classfortable"> <tr> <td nowrap="nowrap"> I have a spreadsheet like matrix in which i don't want wrapping, so i set the white-space to nowrap, now when this matrix gets as large as that it wont fit my screen, the table is resized, but the div the table is in doesn't, how can i make it that the div automatically follow document's width (thus growing when my table grows in width)? </td> </tr> </table> </div> </body></html> Any help, pointers, links to documentation greatly appreciated,greetz,Willem VoogdPS I See now that the POP-code renders the way I want in IE7 as well, the actual problem code, doesn't, however. I figure (=hope) that when i solve the problem in FF, my actual IE7 problem will be solved as well though... Link to comment Share on other sites More sharing options...
FrostbiteXIII Posted May 4, 2006 Share Posted May 4, 2006 Tricky! I have to say thought - very well laid out problem (easy to reproduce etc)! :)I know this is crap (and I dont think I would ever use it myself), but depending what you need, specifying a large width may suffice? .classfordiv { width: 2500px; border: 1px solid black; } .classfortable { width: 2500px; border: 1px solid red; white-space: nowrap; } Sorry, it probably isnt much use...Frosty Link to comment Share on other sites More sharing options...
aspnetguy Posted May 4, 2006 Share Posted May 4, 2006 The only solution I see is to set a fixed width for both the div and table Link to comment Share on other sites More sharing options...
willem Posted May 5, 2006 Author Share Posted May 5, 2006 Yeah, i feared it was not really possible, i think i will just make a javascript solution, that sets the div's width dynamically, thanks for thinking with me though!greetz,Willem Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now