Previous Message
Next Message

Tabular data, aligning different columns differently?

Sent by Dan Kletter on 27 September 2005 05:05

I'm attempting to update an existing homebrewed ecommerce site to
semantic XHTML/CSS.

The initial page is a kind of chinese menu of item descriptions and
prices with room to input quantity per item. I'm treating it as
tabular data and am going to continue to use a table for that part of
the page. The layout uses left-justified text for the item column,
centered for the qty column and right-justified for the price column.

Here's the old, fugly and non-semantic site, warts and all:

Yep, it's a cringer I know.

I really want to keep the style as separate from the structure as
possible. In other words, I want to go from the nightmare that is to
something like this:

<table id="gifts">
			<th scope="col">Description</th>
			<th scope="col">Quantity</th>
			<th scope="col>Min. Donation</th>
			<td><label for="item-x"><a href="#">Artist Shirt and Hoodie Combo</a></label></td>
			<td><input type="text" name=" " /></td>
			<td><label for="item-y"><a href="#">Girlie Shirt and Hoodie Combo</a></label></td>
			<td><input type="text" name=" " /></td>
			<td><input type="submit" value="Submit Gifts" /></td>

Is there is a clever way of styling the text-align for each of the
different columns without resorting to something like:

<td class="foo">


<td align="left">




Yes.  Beautiful, wonderful nature.  Hear it sing to us: *snap*  Yes.  natURE.
css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message