How can I make left border of the cell red? Why this does not work? Thanks!!
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
.main-table {
border-collapse: collapse;
}
.main-table td {
margin: 0px;
padding: 0px;
border: 1px solid #aaa;
padding: 1px 4px 1px 4px;
}
.left-border {
border-left: 1px solid red !important;
}
</style>
</head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
Shouldn’t left-border override the color specified on .main-table td?
<table class='main-table' cellspacing='0' cellpadding='0'>
<tr>
<td> 1 </td>
<td> 366 </td>
</tr>
<tr>
<td > 2 </td>
<td class='left-border'> 777 </td>
</tr>
</table>
</body>
</html>
Set the border to
1px double red. A 1px-wide “double” border looks identical to a “solid”, but has higher precedence in collapsed border computation.