I think I've found the answer. I found this nice summary of CSS
Selectors<http://www.w3schools.com/cssref/css_selectors.asp> and
near the end is :nth-child(n). I ran a few experiments and found this will
turn the 2nd column of all tables yellow:

td:nth-child(2) { background: yellow; }
The problem is I have many tables on the page, so I had to apply that
selector to specific tables. After many experiments I eventually found that
if you give a unique id= to each table then you can do this:

#table1 td:nth-child(2)

However, this worked in my simple test html page but did nothing when I
tried it in a real ASP.NET generated page. So after more bumbling I found
that if each table has a unique class= assigned to it then you can:

.footable td:nth-child(2)

So this lets me "externally" apply formatting to each column of different
tables without the need to touch the table markup. This can reduce the size
of pages considerably.

Greg

Reply via email to