"G. Sørtun" wrote:
> Magnus Fahlström wrote:
>> I don't know how to achieve this without using a table:
>> http://www.magstorm.se/table.htm A table-like design with four
>> columns, with every row numbered, wrapped in a float:left div.
>
> For content that fits the "tabular data" definition, use HTML tables.
I'm not sure whether the content is tabular data, as the example is very
schematic.
HTML tables do not have any automatic numbering feature, so if you want the
numbers to be generated automatically, you would need to use preprocessing,
server-side generation of content, client-side generation of content, or
CSS. An essential question is: would you like to have the numbers there even
if style sheets and/or client-side scripting is disabled?
But if you consider the CSS approach here, then you could use counters and
generated content (which means that the usual CSS caveats apply unusually
strongly). In a simple case (just one table on a page, data rows start with
td with empty content, heading rows don't start with td) you could use the
following:
table { counter-reset: rowcount; }
td:first-child:after {
counter-increment: rowcount;
content: counter(rowcount);
font-weight: bold; }
> For "table look-alike" designs, CSS tables may come handy.
Well, yes, and even for tables if you can't or just won't use HTML tables
(e.g. when you directly format XML data with CSS). But "CSS tables" (e.g.
display: table-cell) are relatively new in terms of browser support.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/