W3C home > Mailing lists > Public > www-html@w3.org > February 2000

RE: Lists in tables

From: David Wagner <dwagner@kevric.com>
Date: Fri, 11 Feb 2000 17:18:54 -0600
Message-Id: <200002112323.SAA31175@tux.w3.org>
To: <www-html@w3.org>
Not only is this possible, it's easy using CSS.  It is not so easy, however,
to find a browser to render it properly (IE5 works).  I pasted HTML below to
show how I have found it much better to use sized inline elements for most
of what used to go into tables.  The spec for tables has become so
complicated it is usually quicker, simpler, and more elegant to just use
lists or other appropriate elements, and reformat them with CSS for
consistantly sized horizontal layout.  If you would like to have fun, set
the height small then add overflow:auto.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  <title>Two Column List Demo</title>
  <style type="text/css">
/*Note the use of em, since there is no character-width unit;*/
/*% works, but keep in mind the width of the container. (IE5 likes them to
total less than 100%)*/

.cola {width:8em;}
.colb {width:8em;padding-left:1em;}
.cola, .colb {vertical-align:top;}
<meta http-equiv="Content-Type" content="text/html">

<p>This demo works in IE5.</p>
<span class="cola">Left Column</span>
<span class="colb">Right Column</span></li><li>
<span class="cola">Left column with far too many words to fit.</span>
<span class="colb">Right Column</span></li><li>
<span class="cola">Left Column</span>
<span class="colb">Right Column</span></li><li>
<span class="cola">Left Column</span>
<span class="colb">Right Column</span></li>

> -----Original Message-----
> From: www-html-request@w3.org
> I'm trying to create a page that has a two column table,
> where the items in the
> left column are numbered (as in an ordered list).  I can't
> seem to find a way to
> arrange the table and list tags in a way that works.  This is
> what the output
> should resemble:
> 1.  Left Column          Right Column
> 2.  Left Column          Right Column
> 3.  Left Column that is  Right Column
>      so long it wraps
> 4.  Left Column          Right Column
> Any suggestions?  Is this even possible?
> Thanks,
> Peter Foti
Received on Friday, 11 February 2000 18:23:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:52 UTC