THEAD & TFOOT for columns

Hello,

Back in August I sparked a discussion thread on www-html about the addition
of 'headers' and 'footers' for columns [1].  As far as I can see there was
no feedback from any of you, and it was partially swamped with discussion
about horizontal scrolling which distracted from what I was getting at.

The main issue is the asymmetry between how groups of rows and groups of
columns can be marked.  While, with columns, you can only say that the
column is a group, with rows you can say whether those rows contain header
or footer information.  Let me take as an example a diary to record the
times of events during the day.  The table element under the present markup
might look something like:

<TABLE>
<CAPTION>My Diary</CAPTION>
<!-- Column giving time -->
<COLGROUP>
<!-- Columns giving daily events -->
<COLGROUP span="7">
<!-- Column giving time -->
<COLGROUP>
<THEAD>
  <TR>
    <TH>Time
    <TH>Monday
    <TH>Tuesday
    ...
    <TH>Sunday
    <TH>Time
<TFOOT>
  <TR>
    <TD>
    <TH>15 September
    <TH>16 September
    ...
    <TH>21 September
    <TD>
<TBODY>
  <TR>
    <TH>8.00am
    <TD>
    ...
    <TH>8.00am
  <TR>
    <TH>9.00am
    <TD>
    ...
    <TH>9.00am
  ...
</TABLE>

Note that the only way to indicate that anything is special about the
left-most and right-most columns is to put them in a column group.  If the
table were turned through 90 degrees, so that the times went at the top and
the days at the side, it would instead look something like:

<TABLE>
<CAPTION>My Diary</CAPTION>
<!-- Column giving day -->
<COLGROUP>
<!-- Columns giving daily events -->
<COLGROUP span="12">
<!-- Column giving date -->
<COLGROUP>
<THEAD>
  <TR>
    <TH>Day
    <TH>8.00am
    <TH>9.00am
    ...
    <TH>19.00am
    <TH>Date
<TFOOT>
  <TR>
    <TD>
    <TH>8.00am
    <TH>9.00am
    ...
    <TH>19.00am
    <TD>
<TBODY>
  <TR>
    <TH>Monday
    <TD>
    ...
    <TH>15 September
  <TR>
    <TH>Tuesday
    <TD>
    ...
    <TH>16 September
  ...
</TABLE>

Now, logically, exactly the same information can be displayed within a
table whether the rows are rows or columns - the cell contents are all to
do with where they are in the *intersection* between rows and columns.  But
we are only allowed to logically markup the *rows* that act as headers and
footers, and not the *columns* which take on the same roles.

What I proposed were two elements that played a similar role to THEAD and
TFOOT, except for columns rather than rows.  Possible names for these
elements could be:
  COLHEAD & COLFOOT
  TRIGHT & TLEFT
or renaming THEAD & TFOOT to HEAD & FOOT, and using RIGHT & LEFT (suggested
by Neil St. Laurent).

The syntax of these elements would be:

 <!--
 TRIGHT & TLEFT group a set of COL elements. It allows you to group
 several columns together as headers or footers.
 -->
 <!ELEMENT (TRIGHT|TLEFT) - O (col)* -- table column header/footer -->
 <!ATTLIST (TRIGHT|TLEFT)
   %attrs;                          -- %coreattrs, %i18n, %events --
   span        NUMBER     1         -- default number of columns in group --
   width       CDATA      #IMPLIED  -- default width for enclosed COLs --
   %cellhalign;                     -- horizontal alignment in cells --
   %cellvalign;                     -- vertical alignment in cells --
   >

The above example could then be marked up as:

<TABLE>
<CAPTION>My Diary</CAPTION>
<!-- Column giving time -->
<TLEFT>
<!-- Columns giving daily events -->
<COLGROUP span="7">
<!-- Column giving time -->
<TRIGHT>
<THEAD>
  <TR>
    <TH>Time
    <TH>Monday
    <TH>Tuesday
    ...
    <TH>Sunday
    <TH>Time
<TFOOT>
  <TR>
    <TD>
    <TH>15 September
    <TH>16 September
    ...
    <TH>21 September
    <TD>
<TBODY>
  <TR>
    <TH>8.00am
    <TD>
    ...
    <TH>8.00am
  <TR>
    <TH>9.00am
    <TD>
    ...
    <TH>9.00am
  ...
</TABLE>

A positive side-effect of these elements is that the right-most and/or
left-most columns could remain static while the rest of the columns
scrolled, in the same way as the top-most and/or bottom-most rows of tables
might.  This is of particular use for wide tables such as accounting
ledgers, time sheets, experimental data, display of database records and so
on.

There were some arguments against the proposal on the www-html list.
Walter Ian Kaye made the point that horizontal scrolling is harder for the
user than vertical scrolling.  jptxs asked why frames couldn't be used
instead.

However, as I pointed out, frames are an incomplete solution, or there
would be no need for THEAD and TFOOT.  And although I doubt whether
horizontal scrolling is much harder than vertical scrolling anyway, I
believe that it is only so difficult because we lose header information to
the left and right, which would not happen if these were kept static - wide
tables are used anyway, anything which increases their effectiveness and
utility has to be a good thing.

Cheers,

Jeni

[1] http://lists.w3.org/Archives/Public/www-html/1997Aug/0124.html


Jeni Tennison
Department of Psychology, University of Nottingham
University Park, Nottingham NG7 2RD, UK
tel: +44 (0) 115 951 5151 x8352
fax: +44 (0) 115 951 5361
url: http://www.psychology.nottingham.ac.uk/staff/Jenifer.Tennison/

Received on Thursday, 18 September 1997 06:35:00 UTC