quote:
Originally posted by Chris Boulton
Of course you can!
Have you seen http://csszengarden.com/?
http://cssvault.com/
http://www.cssbeauty.com/
You don't need the width, I just used it..
Float does what it sounds like it does, it floats something..
Perhaps you were after 3 columns?
<div style="float: left;">Left</div>
<div style="float: right;">Right</div>
<div style="text-align: center;">Center</div>
<table>
<tr>
<td>left</td>
<td>center</td>
<td>right</td>
<tr>
</table>
Is far more logic and easier to understand and doesn't need layers, nor CSS to pull it off... (and the more nested columns and rows you have, the less code you will have with tables compared to div's; in other words, this small example isn't a good way to show the big benefits of tables though)
As I said, div it is almost always used in combination with stylesheets (heck you almost can't do anything with it if you don't).
quote:
Originally posted by WDZ
So technically there can be more than one div in the same space? In that example, the left and right divs are floating above the center div and don't care that it's there? O_o
By using stylesheets yes. But you can do just the same with tables if you want. The method of floating stuff and using multiple layers to create "tables" with div's is more a hack then anything else...
quote:
Originally posted by WDZ
quote:
Originally posted by Chris Boulton
Have you seen http://csszengarden.com/?
Yeah, of course... just some CSS fanatics showing off.
indeed and if they wanted to add a column spanning 4 rows between the already existing columns they will have a hard time finding the appropiate place, changing the code, etc.... While on the other hand if you used tables with something like that, you can add the column in no time without any effort... Oh and, depending on the CSS being used (and layers) pages with div's load relativly slower then with tables.
And that is why tables aren't "shit" at all and are in fact in many circumstances far better then div's. The problem with div's is that most people are blinded by the CSS and all the rumors and misconceptions...