Stecyk
10-19-2007, 05:14 PM
Hi,
I learned my tables knowledge by trolling the internet and finding various examples. I'd like to show my example code to see if I am doing things reasonably right. The good news is that my tables appear the way I want them, so I don't think I am too far off, if at all.
CSS Table Code...
/* KHS Added Table Structure CSS */
table{
border-collapse: collapse;
/* border-left: 2px solid #000; */
border: 2px solid #000;
margin: 2px;
}
caption{
text-align: center;
font-size: 110%;
font-weight: bold;
}
thead tr{
background-color: #A0DCF8;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
tfoot tr{
background-color: #FFFFFF;
}
tfoot td{
text-align: left;
}
thead th{
padding: 0.2em;
white-space: nowrap;
}
tfoot th{
/* font-size: 110%; */
text-align: right;
padding-right: 0.5em;
letter-spacing: 1px;
}
tfoot td{
padding-left: 0.5em;
color: black;
font-size: 100%;
/* font-weight: 600; */
}
tfoot td:hover{
/* background-color: red; */
background-color: #CFD4D9;
/* color: white; */
}
tr{
background-color: #D0EEFC;
}
tr.odd{
background-color: white;
}
th.col{
text-align: center;
}
th.row{
text-align: left;
}
th.alignleft{
text-align: left;
}
th.alignright{
text-align: right;
}
th.aligncenter{
text-align: center;
}
tbody tr:hover{
/* background-color: #FFCCCC; */
background-color: #DAE0E6;
}
td, th{
border: 1px dotted #CCCCCC;
}
td {
text-align: right;
}
td.alignright{
text-align: right;
}
td.alignleft{
text-align: left;
}
td.aligncenter{
text-align: center;
}
td.alignleft-sub{
text-align: left;
padding-left: 20px;
}
td.alignright-sub{
text-align: right;
padding-left: 20px;
}
tbody td
{
padding: 0.2em;
}
You can see an example table in my post here:
http://www.speciousargument.com/blog/archives/2007/10/alberta_royalty_review_part_eleven_undiscounted.php
Here's an example of my table code in that post above...
<table summary="Example of Oil Decline Rates">
<caption>Well Production With Given Decline Rates</caption>
<thead>
<tr>
<th class="col" scope="col"> </th>
<th class="col" scope="col" colspan="4">Daily Production in Barrels</th>
</tr>
<tr>
<th class="col" scope="col">Year</th>
<th class="col" scope="col">3%</th>
<th class="col" scope="col">5%</th>
<th class="col" scope="col">7%</th>
<th class="col" scope="col">10%</th>
</tr>
</thead>
<tfoot>
<tr>
<th class="aligncenter" scope="row">Source:</th>
<td colspan="4">Kevin H. Stecyk</td>
</tr>
</tfoot>
<tbody>
<tr class="odd">
<th class="aligncenter" scope="row">1</th>
<td class="alignright">1000</td>
<td class="alignright">1000</td>
<td class="alignright">1000</td>
<td class="alignright">1000</td>
</tr>
<tr>
<th class="aligncenter" scope="row">2</th>
<td class="alignright">970</td>
<td class="alignright">950</td>
<td class="alignright">900</td>
<td class="alignright">850</td>
</tr>
...blah blah blah...
</table>
My code above is better formatted with proper indentation. Not sure why it doesn't show properly.
Are there any glaring errors? My concern is most focused on the alignment of the cells. But I think I am okay.
Best regards,
Kevin
I learned my tables knowledge by trolling the internet and finding various examples. I'd like to show my example code to see if I am doing things reasonably right. The good news is that my tables appear the way I want them, so I don't think I am too far off, if at all.
CSS Table Code...
/* KHS Added Table Structure CSS */
table{
border-collapse: collapse;
/* border-left: 2px solid #000; */
border: 2px solid #000;
margin: 2px;
}
caption{
text-align: center;
font-size: 110%;
font-weight: bold;
}
thead tr{
background-color: #A0DCF8;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
tfoot tr{
background-color: #FFFFFF;
}
tfoot td{
text-align: left;
}
thead th{
padding: 0.2em;
white-space: nowrap;
}
tfoot th{
/* font-size: 110%; */
text-align: right;
padding-right: 0.5em;
letter-spacing: 1px;
}
tfoot td{
padding-left: 0.5em;
color: black;
font-size: 100%;
/* font-weight: 600; */
}
tfoot td:hover{
/* background-color: red; */
background-color: #CFD4D9;
/* color: white; */
}
tr{
background-color: #D0EEFC;
}
tr.odd{
background-color: white;
}
th.col{
text-align: center;
}
th.row{
text-align: left;
}
th.alignleft{
text-align: left;
}
th.alignright{
text-align: right;
}
th.aligncenter{
text-align: center;
}
tbody tr:hover{
/* background-color: #FFCCCC; */
background-color: #DAE0E6;
}
td, th{
border: 1px dotted #CCCCCC;
}
td {
text-align: right;
}
td.alignright{
text-align: right;
}
td.alignleft{
text-align: left;
}
td.aligncenter{
text-align: center;
}
td.alignleft-sub{
text-align: left;
padding-left: 20px;
}
td.alignright-sub{
text-align: right;
padding-left: 20px;
}
tbody td
{
padding: 0.2em;
}
You can see an example table in my post here:
http://www.speciousargument.com/blog/archives/2007/10/alberta_royalty_review_part_eleven_undiscounted.php
Here's an example of my table code in that post above...
<table summary="Example of Oil Decline Rates">
<caption>Well Production With Given Decline Rates</caption>
<thead>
<tr>
<th class="col" scope="col"> </th>
<th class="col" scope="col" colspan="4">Daily Production in Barrels</th>
</tr>
<tr>
<th class="col" scope="col">Year</th>
<th class="col" scope="col">3%</th>
<th class="col" scope="col">5%</th>
<th class="col" scope="col">7%</th>
<th class="col" scope="col">10%</th>
</tr>
</thead>
<tfoot>
<tr>
<th class="aligncenter" scope="row">Source:</th>
<td colspan="4">Kevin H. Stecyk</td>
</tr>
</tfoot>
<tbody>
<tr class="odd">
<th class="aligncenter" scope="row">1</th>
<td class="alignright">1000</td>
<td class="alignright">1000</td>
<td class="alignright">1000</td>
<td class="alignright">1000</td>
</tr>
<tr>
<th class="aligncenter" scope="row">2</th>
<td class="alignright">970</td>
<td class="alignright">950</td>
<td class="alignright">900</td>
<td class="alignright">850</td>
</tr>
...blah blah blah...
</table>
My code above is better formatted with proper indentation. Not sure why it doesn't show properly.
Are there any glaring errors? My concern is most focused on the alignment of the cells. But I think I am okay.
Best regards,
Kevin