Auto-number table rows?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    Auto-number table rows?

    Is it possible to auto-number rows of a table, similar to how <LI> is used
    to number a series of lines?


  • Thomas Scholz

    #2
    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

    Comment

    • Philipp Lenssen

      #3
      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.

      Comment

      Working...