Jump to content

div/table/nowrap problem


willem

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...