pkskytektip
Programmer
I am trying to set the left-border so that it shows with a solid border on the left of only certain columns set with a certain class. But I am getting no settings being shown.
Here is a simple example of what I am trying to do:
Copy and paste this into a new HTML page and you should see background colors for certain rows and certain columns. Notice that this class setting does not work:
But similarly set inline style settings do work. And of course the background setting for the two classes .CC0 and .CC1 also work fine.
Why don't the element-class combination settings work? What is the best way of getting the desired results without using inline settings?
Here is a simple example of what I am trying to do:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
.CC0 {
background-color:#CCCCFF;
}
.CC1 {
background-color:#9999CC
}
tr.CC0, tr.CC1, col.CC0, td.CC0 {
border-left: solid #FF0000 3px
}
td {
/*This works on all the cells
border-left: solid #FF0000 3px*/
}
</style>
</head>
<body>
<table width="50%" cellspacing="0">
<tr class="CC0">
<td style= "border-left: solid #FF0000 3px" colspan="2"> </td>
<td colspan="2"> </td>
</tr>
<tr class="CC1">
<td colspan="2"> </td>
<td colspan="2"> </td>
</tr>
<colgroup span="2">
<col class="CC0" />
<col class="CC1" />
</colgroup>
<colgroup span="2">
<col class="CC0" />
<col class="CC1" />
</colgroup>
<tr>
<td style= "border-left: solid #FF0000 3px"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td style= "border-left: solid #FF0000 3px"> </td>
<td> </td>
</tr>
</table>
</body>
</html>
Copy and paste this into a new HTML page and you should see background colors for certain rows and certain columns. Notice that this class setting does not work:
Code:
tr.CC0, tr.CC1, col.CC0, td.CC0 {
border-left: solid #FF0000 3px
}
But similarly set inline style settings do work. And of course the background setting for the two classes .CC0 and .CC1 also work fine.
Why don't the element-class combination settings work? What is the best way of getting the desired results without using inline settings?