suicide1405241470 0 Report post Posted September 10, 2004 Hi,is there somekind of CSS style i could apply for tables to have diferent colors in diferent lines??? Separated one by one?This way my tables will all have (for example) a red row, a yellow row, a red row, a yellow row, a red row, a yello row, etc...If not, what can i do to achieve this? Share this post Link to post Share on other sites
overture 0 Report post Posted September 10, 2004 you can make classes in CSS like this: .red { background-color: red;}.yellow { background-color: yellow;} and for each row you want red add this to the <td>:class="red"<td class="red">for yellow add this:class="yellow"<td class="yellow"> Share this post Link to post Share on other sites
avalon1405241471 0 Report post Posted October 27, 2004 It better to place it in <tr> if you want the whole row to be color with specific color. <style>.background_red {background-color: red;}.background_yellow {background-color: yellow;}.background_blue {background-color: blue;}</style><table cellspacing="0" cellpadding="3" border="0"><tr class="background_red"><td>Column 1</td><td>Column 2</td><tr><tr class="background_yellow"><td>Column 1</td><td>Column 2</td><tr><tr class="background_blue"><td>Column 1</td><td>Column 2</td><tr></table> Share this post Link to post Share on other sites
lhunath 0 Report post Posted October 27, 2004 tr { background: red; }tr + tr { background: blue; }Only standard compliant browsers, though. No buggy ones, like IE. Share this post Link to post Share on other sites
Hercco 0 Report post Posted October 28, 2004 tr { background: red; }tr + tr { background: blue; }Only standard compliant browsers, though. No buggy ones, like IE. <{POST_SNAPBACK}> This is probably the most suckiest flaw in IE (at least if you don't take security into account...). With tables that have several columns making every other row different colour makes it highly more readable. But as IE doesn't suppory this and it is like 95% of people in the web using it, you gotta go with clumsy <tr class= .Geez I hate IE... Share this post Link to post Share on other sites
r3d1405241470 0 Report post Posted October 28, 2004 This is probably the most suckiest flaw in IE (at least if you don't take security into account...). With tables that have several columns making every other row different colour makes it highly more readable. But as IE doesn't suppory this and it is like 95% of people in the web using it, you gotta go with clumsy <tr class= . Geez I hate IE... <{POST_SNAPBACK}> ie 6.0 doesn't support all new property that release on css 2.1, have a 40-60% support to css 2, and 80-90% support to css1, that's why it's buggy. besides ms create its own property of css that only works on ie browser. anyone remember the colored scrollbar Share this post Link to post Share on other sites
lhunath 0 Report post Posted October 28, 2004 One link to solve all your problems: http://dean.edwards.name/IE7/intro/ Share this post Link to post Share on other sites
r3d1405241470 0 Report post Posted October 28, 2004 cool js patch for ie. i though it was a new version of ie i think you don't need this coz it's not that hard to cheat ie bugs, check the alpha version of my site http://www.r3d.info/. site is tested in ie5.5+, mozi and opera Share this post Link to post Share on other sites
lhunath 0 Report post Posted October 29, 2004 I know that, but it fixes alot more than bugs. Only just go and look at what support it offers in IE! http://dean.edwards.name/IE7/compatibility/ No way you can do that with CSS Hacks. This patch is the ultimate solution for MS's crap, which, normal users have to go and clean up again as usual. Share this post Link to post Share on other sites
r3d1405241470 0 Report post Posted October 29, 2004 i think that's my last option, coz some ppl disable or hate js and most web users now is migrating to firefox Share this post Link to post Share on other sites
bbdesign 0 Report post Posted November 4, 2004 life would be so much easier if everyone would use firefox- that way we would only have to code to a single standard and not be bothered with workarounds... Share this post Link to post Share on other sites
Hercco 0 Report post Posted November 5, 2004 Hats off to Dead Edwards! That is truly amazing work. I'm most likely going to start using that i think that's my last option, coz some ppl disable or hate js and most web users now is migrating to firefox <{POST_SNAPBACK}> I don't see javascript being disabled a huge problem. Javascript is usually disabled for security reasons. Now if a person is concerned about security he is usually a bit more aware of the technology than the average web user and most likely is not going to use IE. My rough and in no way statistic relying guess is that less than a per cent of the Internet Explorers that are used in the web have constantly javascript disabled. Javascript haters are using something else. And besides, asking people to enable javascript to view your site correctly is lot less than to ask them to download, install and switch browser. You can also explain why you require javascript, if for nothing else than to make your users blame it on Microsoft. Share this post Link to post Share on other sites