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. Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/ Share on other sites More sharing options...
haku Posted July 5, 2010 Share Posted July 5, 2010 Say what? Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1081404 Share on other sites More sharing options...
bobby317 Posted July 5, 2010 Share Posted July 5, 2010 Show complete code and CSS please Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1081481 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] Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1082335 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? Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1085314 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> Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1085540 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? Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1085743 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. Link to comment https://forums.phpfreaks.com/topic/206777-is-this-how-css-is-meant-to-behave-floating-tables/#findComment-1085810 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.