Connecting Tech Pros Worldwide Forums | Help | Site Map

Auto-number table rows?

Dave
Guest
 
Posts: n/a
#1: Jul 20 '05
Is it possible to auto-number rows of a table, similar to how <LI> is used
to number a series of lines?



Thomas Scholz
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Auto-number table rows?


Dave gestand:
[color=blue]
> Is it possible to auto-number rows of a table, similar to how <LI> is
> used to number a series of lines?[/color]

From one of my diagnostic user stylesheets:

tr:before {
content: counter(tr) !important;
counter-increment: tr !important;
padding: 0 3px !important;
display: table-cell !important;
}

But ... this works in Opera only.

Thomas
Philipp Lenssen
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Auto-number table rows?


Thomas Scholz wrote:
[color=blue]
> Dave gestand:
>[color=green]
> > Is it possible to auto-number rows of a table, similar to how <LI>
> > is > used to number a series of lines?[/color]
>
> From one of my diagnostic user stylesheets:
>
> tr:before {
> content: counter(tr) !important;
> counter-increment: tr !important;
> padding: 0 3px !important;
> display: table-cell !important;
> }
>[/color]

Looks very interesting.

To the original author, don't forget that CSS should be an optional
layout enhancement of the content presented as HTML. So if it's very
important to have the numbers show, CSS won't do the job. A numbered
<li> is a bit different in that respect because the <ol> is defined in
HTML.
Closed Thread