2 ms·
Because in the past, people used to use tables for everything. Want to add some spacing? Create a table with invisible columns that contain 1-pixel gifs "spacer
by hasenj 16y ago
Because in the past, people used to use tables for everything. Want to add some spacing? Create a table with invisible columns that contain 1-pixel gifs "spacer.gif".
Now adays these things can happen with CSS, and you should use css to get spacing and positioning done right.
However, for layout, I completely disagree with the mainstream idea that "divs and css are better than tables for layout".
#1 argument, they say, is that tables are semantically incorrect for layout.
Well then, are divs semantically correct for layout? Absolutely not. Actually, tables are semantically correct for layout.
How else do you express stacking elements vertically and horizontally?
Floating divs to create layout is a horrible hack, and it's not maintainable at all.
Use tables to get the basic layout, but do all the styling with css.
- pbhjpbhj 16y ago>Well then, are divs semantically correct for layout? Absolutely not. Adding a div adds no semantic meaning to the page. Adding a table tells you that the elements in the different columns and rows relate to one another, that the rows or columns duplicate data types that the td have relationships with one another as data. Tables are semantically correct for arranging data that is related correctly when presented in a table; but this is not "layout" in terms of visual appearance. The semantics of the data table aren't necessarily related to the layout - imagine a table of <name,image,date> tuples that you arrange as floating polaroid imges using some javascript. >How else do you express stacking elements vertically and horizontally? If ordering is important for the meaning of the data then use lists (ol) if 2D ordered data is being presented then you have a table and using the table element is expected. The web is not print media and was designed to convey information (to myriad different UA) and not to give rigid print-like presentation of that same information.