PDA

View Full Version : using display:table



wishiwasageek
06-01-2005, 02:11 AM
Ok everyone's against tables unless it has data;

so for layout what about using the display:table property and attributes?

What are the pitfalls/tips and tricks for using in Firefox and IE?
Anything weird/difficult I should know?

I already know about valign and vertical-align not being the same - how do you counteract that?

mwinter
06-01-2005, 03:27 PM
Ok everyone's against tables unless it has dataThe vast majority of layouts can be achieved fairly easily, and with less clutter, then the equivalent table approach. The use of layout-tables can also have adverse effects on accessibility as the tables may be linearised in a manner that renders the contents nonsensical.


so for layout what about using the display:table property and attributes?The table value (and its relations) are meant for XML documents, for example. As a user-defined document type won't have any built-in layout semantics, table-like structures can be rendered as tables by styling them with the table-related display values.


What are the pitfalls/tips and tricks for using in Firefox and IE?
Anything weird/difficult I should know?As I recall, IE won't understand it.


I already know about valign and vertical-align not being the same - how do you counteract that?The valign attribute is not deprecated for table-related elements, so you can use it freely.

If you need help producing a certain layout, wouldn't it be easier to construct it using tables, then ask how it could be done without them? If you want to learn on your own, then by all means do (I am not trying to push you in any particular direction), but it is certainly easier to help you when we know exactly what you're trying to do and why.

Mike

wishiwasageek
06-02-2005, 12:40 AM
Usually the biggest problem I have is trying to put things inline
ie
<tr>
<td> </td><td></td>
</tr>

Bloody simple with tables.
but I'm learning to use CSS.
Not really sure that
<div>(table)
<div>(row)
<span> </span><span> </span>(table cells)
etc

is really all that different to using a table for layout.

Just trying to find out why it's worth the bother of using CSS which is proving a pain (I admit do to my lack of knowledge)

Little things(!) like you can't specify a measurement for inline elements (or is that only non-replaced inline elements??)

Anyway, learning learning.Thanks again for explaining stuff. REally appreciate it.

WIWAG :o