|
New Tutorial
CSS Selectors Tutorial
Want to make tables with css borders? It's easy with css selectors.
Example
| First |
Last |
Address |
| John |
Smith |
5555 Generic Way |
| Bill |
Frankford |
3333 Main Street |
The CSS Code
table.datatable tr td {
border-left: 1px solid gray;
border-top: 1px solid gray;
padding: 5px;
}
table.datatable {
border-bottom: 1px solid gray;
border-right: 1px solid gray;
}
The HTML Code
<table class="datatable" cellspacing="0">
<tr>
<td>First</td>
<td>Last</td>
<td>Address</td>
</tr>
<tr>
<td>John</td>
<td>Smith</td>
<td>5555 Generic Way</td>
</tr>
<tr>
<td>Bill</td>
<td>Frankford</td>
<td>3333 Main Street</td>
</tr>
</table>
|