I am trying to better understand inheritance in css.
I have a table that I set up with alternate colors for the rows.
table.X5
{
border-left: 12px groove #bebea9;
border-top: 12px groove #bebea9;
border-right: 12px groove #909070;
border-bottom: 12px groove #909070;
}
table.X5 tr.odd td
{
background-color: red;
color: #efef00;
text-align: left;
border: 4px solid pink;
}
table.X5 tr.evn td
{
background-color: green;
color: #00efef;
text-align: right;
border: 4px solid lime;
}
the table is:
<table class="X5" cellspacing="2">
<tr class="odd">
<td>
</td>
<td>
John
</td>
<td>
Jane
</td>
<td>
Total
</td>
</tr>
<tr class="evn">
<td>
January
</td>
<td>
123
</td>
<td>
234
</td>
<td>
357
</td>
</tr>
<tr class="odd">
<td>
February
</td>
<td>
135
</td>
<td>
246
</td>
<td>
381
</td>
</tr>
<tr class="evn">
<td>
March
</td>
<td>
257
</td>
<td>
368
</td>
<td>
625
</td>
</tr>
<tr>
<td>
Total
</td>
<td>
515
</td>
<td>
848
</td>
<td>
1363
</td>
</tr>
</table>
this creates a table with alternating rows colored green and red with pink and light green borders around the cells (td).
If I change the style to take the td's off it looks all the same except for the pink and light green borders.
table.X5
{
border-left: 12px groove #bebea9;
border-top: 12px groove #bebea9;
border-right: 12px groove #909070;
border-bottom: 12px groove #909070;
}
table.X5 tr.odd
{
background-color: red;
color: #efef00;
text-align: left;
border: 4px solid pink;
}
table.X5 tr.evn
{
background-color: green;
color: #00efef;
text-align: right;
border: 4px solid lime;
}
Why did taking the tds off the tr lines apply everything but the borders?
Thanks,
Tom
I have a table that I set up with alternate colors for the rows.
table.X5
{
border-left: 12px groove #bebea9;
border-top: 12px groove #bebea9;
border-right: 12px groove #909070;
border-bottom: 12px groove #909070;
}
table.X5 tr.odd td
{
background-color: red;
color: #efef00;
text-align: left;
border: 4px solid pink;
}
table.X5 tr.evn td
{
background-color: green;
color: #00efef;
text-align: right;
border: 4px solid lime;
}
the table is:
<table class="X5" cellspacing="2">
<tr class="odd">
<td>
</td>
<td>
John
</td>
<td>
Jane
</td>
<td>
Total
</td>
</tr>
<tr class="evn">
<td>
January
</td>
<td>
123
</td>
<td>
234
</td>
<td>
357
</td>
</tr>
<tr class="odd">
<td>
February
</td>
<td>
135
</td>
<td>
246
</td>
<td>
381
</td>
</tr>
<tr class="evn">
<td>
March
</td>
<td>
257
</td>
<td>
368
</td>
<td>
625
</td>
</tr>
<tr>
<td>
Total
</td>
<td>
515
</td>
<td>
848
</td>
<td>
1363
</td>
</tr>
</table>
this creates a table with alternating rows colored green and red with pink and light green borders around the cells (td).
If I change the style to take the td's off it looks all the same except for the pink and light green borders.
table.X5
{
border-left: 12px groove #bebea9;
border-top: 12px groove #bebea9;
border-right: 12px groove #909070;
border-bottom: 12px groove #909070;
}
table.X5 tr.odd
{
background-color: red;
color: #efef00;
text-align: left;
border: 4px solid pink;
}
table.X5 tr.evn
{
background-color: green;
color: #00efef;
text-align: right;
border: 4px solid lime;
}
Why did taking the tds off the tr lines apply everything but the borders?
Thanks,
Tom