1 reply [Last post]
cookiebar
Offline
newbie
Last seen: 14 years 51 weeks ago
Joined: 2005-12-11
Posts: 1
Points: 0

Would it be possible to alternate 2 different colors on all table lines by defining a single style for the table & lines, by applying the same CSS style to all lines.
I'd like to avoid creating 2 styles for color 1 and color 2.

Example :
Table
Line 1 : color 1
Line 2 : color 2
Line 3 : color 1
Line 4 : color 2
Line 5 : color 1
... Shock

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 6 years 7 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

2 colors in a single style

If you're talking about different colours for alternating rows, then, no, I don't think there is a way around using different classes.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference