cs.punk Posted July 5, 2010 Share Posted July 5, 2010 .div1 { float: left; border: solid 2px #CC6644; } table { float: left; } As soon as the table contains a row that spans over one line, the table goes below the div. Unless you remove the float from table {}. Using Firefox 3.5. Works fine in IE 7. Quote Link to comment Share on other sites More sharing options...
haku Posted July 5, 2010 Share Posted July 5, 2010 Say what? Quote Link to comment Share on other sites More sharing options...
bobby317 Posted July 5, 2010 Share Posted July 5, 2010 Show complete code and CSS please Quote Link to comment Share on other sites More sharing options...
cs.punk Posted July 7, 2010 Author Share Posted July 7, 2010 Sorry guys.. CSS .div1 { border: solid 2px #CC6644; float: left; } table { float: left; } XHTML <div class='div1'> <p>test test test </p> </div> <table border='1'> <tr> <th>Title</th> <th>Test</th> </tr> <tr> <td>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </td> <td>2</td> </tr> </table> With this code the table does not 'float against' div1 (fig 1) ONLY once I remove the float from table* does it float normally (fig 2). * table { } This happens in firefox, in IE it works perfectly. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
cs.punk Posted July 13, 2010 Author Share Posted July 13, 2010 bump Could this possibly be a firefox bug? Quote Link to comment Share on other sites More sharing options...
xcoderx Posted July 13, 2010 Share Posted July 13, 2010 just tested and it does float. if u dont set a width how will u know if it is floating or not lol <style type="text/css"> .div1 { border: solid 2px #ff0000; float: left; margin:10px; } table { float: left; width:600px; color:#ff0000; } </style> <div class='div1'> <p>test test test </p> </div> <table border='1'> <tr> <th>Title</th> <th>Test</th> </tr> <tr> <td>test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </td> <td>2</td> </tr> </table> Quote Link to comment Share on other sites More sharing options...
cs.punk Posted July 14, 2010 Author Share Posted July 14, 2010 Why can't the table be flexible and re-size itself to the max possible? Quote Link to comment Share on other sites More sharing options...
otuatail Posted July 14, 2010 Share Posted July 14, 2010 what hapens if the first class div1 has a height: atribute. Desmond. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.