The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Styling a Table Column without a Class

I am styling a 4 column table and 4th column has number data which I want to text-align: right (the other 3 columns are left), but I'm not interested in applying a class to each <td>. Is there an alternate way to do this, or is the class the only way?

I think that in CSS2 the class is your only hope.
However, you could create one big table with two cells, put the first tree columns in a table in the left cell, and the last (4th) column in a table in the right cell of the big table, and give this whole cell a text-align: right.

Remember to code according to data information. For instance, if you see tabular data build with a table. Also, remember div's are non-semantic elements even though they are a necessity. If you were to use all div's instead of a table the data would be meaningless.

It has been posited that divs shouldn't directly contain textual data, and should instead be populated only with block-level elements.

Originally Posted by http://www.w3.org/html/wg/html5/#the-div

Allowing div elements to contain phrasing content makes it easy for authors to abuse div, using it with the class="" attribute to the point of not having any other elements in the markup. This is a disaster from an accessibility point of view, and it would be nice if we could somehow make such pages non-compliant without preventing people from using divs as the extension mechanism that they are, to handle things the spec can't otherwise do (like making new widgets).