Table headings

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

    Table headings

    For illustration purposes, I've put up a sample HTML table at

    h.t.t.p.++myweb pages.comcast.n et/hmessinger/table-headers.html

    (sorry for the munging) that shows a typical arrangement for a printed
    table. I used <th> for the row and column headings. If I were using axis and
    id attributes, I'd put them in these cells and refer to them in header
    attributes. But I'm not sure what to do about the cell reading "Countries"
    or about the cell reading "Population ". These are more or less
    "meta-headers". Should they be <th> as well? Should they have axis, header,
    and id attributes? Or should they be left as plain vanilla <td>? (The
    *appearance* of these cells, of course, is to be handled by CSS.)

    --
    Harlan Messinger
    Remove the first dot from my e-mail address.
    Veuillez ôter le premier point de mon adresse de courriel.

  • Peter Foti

    #2
    Re: Table headings

    "Harlan Messinger" <h.messinger@co mcast.net> wrote in message
    news:bmplrj$pf6 l9$1@ID-114100.news.uni-berlin.de...[color=blue]
    > For illustration purposes, I've put up a sample HTML table at
    >
    > h.t.t.p.++myweb pages.comcast.n et/hmessinger/table-headers.html
    >
    > (sorry for the munging) that shows a typical arrangement for a printed
    > table. I used <th> for the row and column headings. If I were using axis[/color]
    and[color=blue]
    > id attributes, I'd put them in these cells and refer to them in header
    > attributes. But I'm not sure what to do about the cell reading "Countries"
    > or about the cell reading "Population ". These are more or less
    > "meta-headers". Should they be <th> as well? Should they have axis,[/color]
    header,[color=blue]
    > and id attributes? Or should they be left as plain vanilla <td>? (The
    > *appearance* of these cells, of course, is to be handled by CSS.)
    >[/color]

    Look at the example in the HTML spec here:



    (scroll down a little and you will see a picture similar to your case).
    They used <th>, which seems appropriate for your case as well.

    Regards,
    Peter Foti


    Comment

    • Jukka K. Korpela

      #3
      Re: Table headings

      "Harlan Messinger" <h.messinger@co mcast.net> wrote:
      [color=blue]
      > For illustration purposes, I've put up a sample HTML table at
      >
      > h.t.t.p.++myweb pages.comcast.n et/hmessinger/table-headers.html
      >
      > (sorry for the munging)[/color]

      Why on &Planet; do you munge Web addresses? If you don't want the page
      to be indexed for search engines (which might find copies of Usenet
      articles), use robot exclusion in a <meta> tag. Not that I would worry
      more about such issues than about causing trouble to people who are
      asked to help for free with Web authoring problems.
      [color=blue]
      > that shows a typical arrangement for a printed table.[/color]

      Printed? In what sense? It contains a normal table, which can be
      spoken, displayed on screen, and naturally printed too.
      [color=blue]
      > I used <th> for the row and column headings.[/color]

      Fine, though it is debatable whether the country names are just
      headings. The semantic distinction between <td> and <th> is not crystal
      clear in the specifications. The strange thing is that there is a
      crucial (in principle) statement that only appears in a DTD comment:
      "TH is for headers, TD for data, but for cells acting as both use TD"
      [color=blue]
      > If I
      > were using axis and id attributes, I'd put them in these cells and
      > refer to them in header attributes.[/color]

      Why would you use them? Only some complex tables need them. For normal
      tables, the scope attribute is sufficient for making the associations
      between header cells and data cells clear. And you can use it in <td>
      elements too - the specification contains examples thereof. So I would
      use <td scope="row">Aba lonia</td> instead of <th>Abalonia</th>.
      [color=blue]
      > But I'm not sure what to do
      > about the cell reading "Countries" or about the cell reading
      > "Population ". These are more or less "meta-headers". Should they be
      > <th> as well?[/color]

      The look pretty normal column headers to me, <th scope="col"> and
      <th scope="colgroup ">, respectively.

      --
      Yucca, http://www.cs.tut.fi/~jkorpela/
      Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

      Comment

      Working...