Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS and Rows

Status
Not open for further replies.

napoleao

IS-IT--Management
Feb 20, 2002
172
PT
How can i make row1 appear with one background and make row 2 appear with other colour and then keep alternating from row 3, 4, and so on? Using Cascade Styly Sheets
At the moment I have this Style.css

body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #ffffff;
}
table {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
}

 
Something like this may help

<html>
<head>
<style type=&quot;text/css&quot;>
<!--
.FirstRow {
background-color: #AACCFF;
}
-->
</style>
</head>
<body>
<table>
<tr class=&quot;FirstRow&quot;>
<td ><b>Some Data</b></td>
<td>A Longer Bit of Data Here</td>
<td>Short</td>
</tr>
</table>
</body>
</html>
 
thanks but i am still not sure, can i add the style directed to my css file and then use it?
 
yes:
<css page>
How can i make row1 appear with one background and make row 2 appear with other colour and then keep alternating from row 3, 4, and so on? Using Cascade Styly Sheets
At the moment I have this Style.css

body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
background-color: #ffffff;
}
table {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: xx-small;
font-style: normal;
line-height: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
color: #000000;
text-decoration: none;
}
.FirstRow {
background-color: #AACCFF;
}
</css page>

<html>
...
<tr class=&quot;FirstRow&quot;>
...
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top