Forum Moderators: not2easy
table {
border: 1px solid;
border-collapse: collapse;
font-size: 0.83em;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
td {
padding: 0.2em;
background-color: white;
}
th {
background: blue;
color: #FFFFFF;
padding: 0em;
text-align: center;
}
th a:link {
background: #A0522D;
color: yellow;
}
th a:visited {
background: #A0522D;
color: white;
}
[edited by: alt131 at 7:16 pm (utc) on Jul 9, 2011]
[edit reason] Thread Tidy [/edit]
tr.pme-row-0{
background-color: #ffffff;
color: #000000;
}
tr.pme-row-1{
background-color: #f0f0f0;
color: #000000;
} tr.pme-row-0 td {
background-color: #ffffff;
color: #000000;
}
tr.pme-row-1 td {
background-color: #f0f0f0;
color: #000000;
} .pme-cell-0-align-center, .pme-cell-1-align-center, .pme-header-align-center {
text-align: center;
vertical-align: middle;
}
.pme-cell-0-left-justify, .pme-cell-1-left-justify, .pme-header-left-justify {
text-align: left;
vertical-align: middle;
}
.pme-header-right-justify, .pme-cell-0-right-justify, .pme-cell-1-right-justify {
text-align: right;
vertical-align: middle;
}
.tac {text-align: center;}
.tal {text-align: left;}
.tar {text-align: right;}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
<table class="pme-main" summary="gwr">
<tr class="pme-header">
<th><input type="submit" class="pme-hide" name="PME_sys_sw" value="Hide"><input type="submit" class="pme-clear" name="PME_sys_sw" value="Clear"></th>
<th><a href="#">Class</a></th>
<th><a href="#">class2</a></th>
<th><a href="#">Br #</a></th>
<th><a href="#">GWR Num</a></th>
<th><a href="#">Prev GWR #</a></th>
<th><a href="#">Loco Name</a></th>
<th><a href="#">Wheel</a></th>
<th><a href="#">Builder</a></th>
<th><a href="#">Build No</a></th>
<th><a href="#">Build</a></th>
<th><a href="#">Date</a></th>
<th><a href="#">Wdrn</a></th>
<th><a href="#">Date</a></th>
<th><a href="#">Shed Code</a></th>
<th><a href="#">Ultimate Allocation</a></th>
<th><a href="#">Disposal Detail</a></th>
<th><a href="#">Date</a></th>
<th><a href="#">Cut</a></th>
<th><a href="#">Notes</a></th>
</tr>
<tr class="pme-filter">
<td><input type="submit" class="pme-query" name="PME_sys_filter" value="Search"></td>
<td><input value="" type="text" name="PME_sys_qf1" maxlength="8" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf2" maxlength="20" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf3" maxlength="4" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf4" maxlength="4" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf5" maxlength="4" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf6" maxlength="42" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf7" maxlength="7" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf8" maxlength="21" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf9" maxlength="8" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf10" maxlength="3" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf11" maxlength="4" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf12" maxlength="3" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf13" maxlength="4" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf14" maxlength="5" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf15" maxlength="27" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf16" maxlength="50" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf17" maxlength="7" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf18" maxlength="4" onkeypress="#"></td>
<td><input value="" type="text" name="PME_sys_qf19" maxlength="68" onkeypress="#"></td>
</tr>
<tr class="pme-sortinfo">
<td><a href="#">Clear</a></td>
<td colspan="19">Sorted By: ID ascending</td>
</tr>
<tr class="pme-row-0">
<td><a href="#"><img class="pme-navigation-0" src="./resources/images/pme-view.png" height="15" width="16" alt="View"></a></td>
<td>Unclass</td>
<td> </td>
<td>0</td>
<td>2</td>
<td>66</td>
<td> </td>
<td>0-4-4T</td>
<td>Vulcan Foundry Ltd</td>
<td>1348</td>
<td>Aug</td>
<td>1892</td>
<td>Jul</td>
<td>1924</td>
<td>BRY</td>
<td>Barry</td>
<td>Swindon Works</td>
<td>circa</td>
<td>1924</td>
<td> </td>
</tr>
<tr class="pme-row-1">
<td><a href="#"><img class="pme-navigation-1" src="./resources/images/pme-view.png" height="15" width="16" alt="View"></a></td>
<td>Unclass</td>
<td> </td>
<td>0</td>
<td>3</td>
<td>67</td>
<td> </td>
<td>0-4-4T</td>
<td>Vulcan Foundry Ltd</td>
<td>1349</td>
<td>Aug</td>
<td>1892</td>
<td>Apr</td>
<td>1929</td>
<td>BRY</td>
<td>Barry</td>
<td> </td>
<td>circa</td>
<td>1929</td>
<td> </td>
</tr>
</table>
</body>
<style type="text/css" media="screen">
table.pme-main {
border-collapse: collapse;
font-size: 12px;
font-family: arial, sans-serif;
}
table.pme-main th {
font-weight: normal; /* remove this if you want bold text in the header row, it will increase "gaps" */
background: #A0522D;
color: #FFFFFF;
padding: 0 1px; /* for the tiniest gap between each column */
}
table.pme-main th a:link {
background: #A0522D;
color: Yellow;
}
table.pme-main th a:visited {
background: #A0522D;
color: #999999;
}
table.pme-main td { padding: 0 1px;}
table.pme-main tr.pme-filter td { padding: 0 0 0 1px;} /* remove padding from the "inputs" row */
table.pme-main img {
border: 0;
display: block;
margin: 0 auto;
}
table.pme-main .pme-row-0 td {
background-color: #ffffff;
color: #000000;
}
table.pme-main .pme-row-1 td {
background-color: #f0f0f0;
color: #000000;
}
table.pme-main .pme-filter td {
background-color: silver;
color: #000000;
}
table.pme-main .pme-sortinfo,
table.pme-main .pme-queryinfo {
background-color: #FFFF00;
color: #000000;
}
table.pme-main input {width: 100%; display: block;} /* all inputs will inherit width from parent cell, this width must be explicitly set see long rules below! */
/* column width & alignment */
/* col1 */
table.pme-main th,
table.pme-main td {text-align: center; width: 68px;}
/* col2 */
table.pme-main th+th,
table.pme-main td+td {text-align: right; width: 50px;}
/* col3 */
table.pme-main th+th+th,
table.pme-main td+td+td {text-align: left; width: 50px;}
/* col4 */
table.pme-main th+th+th+th,
table.pme-main td+td+td+td {text-align: center; width: 25px;}
/* col5 */
table.pme-main th+th+th+th+th,
table.pme-main td+td+td+td+td {text-align: center; width: 30px;}
/* col6 */
table.pme-main th+th+th+th+th+th,
table.pme-main td+td+td+td+td+td {text-align: center; width: 30px;}
/* col7 */
table.pme-main th+th+th+th+th+th+th,
table.pme-main td+td+td+td+td+td+td {text-align: left; width: 100px;}
/* col8 */
table.pme-main th+th+th+th+th+th+th+th,
table.pme-main td+td+td+td+td+td+td+td {text-align: center; width: 50px;}
/* exceptions to above widths and alignment */
table.pme-main tr.pme-sortinfo td+td {width: auto; text-align: left;} /* target the cell that spans 19 columns in row 3 */
</style>
BTW tac, tal, tar refused to work until I modified them to
.pme-cell-0-tal, .pme-cell-1-tal, .pme-cell-header-tal{
text-align: left;
}
.pme-query,
.pme-header,
.pme-filter;{
width: 60px;
}
CSS customization
Per field, you can define field CSS class names postfix. This is especially useful in order to highlight one
column in a table.
Example 4-8. Field CSS customization
$opts[’fdd’][’col_name’][’css’] = array(
’postfix’ => ’ColName’
);
[edited by: coopster at 2:48 pm (utc) on Feb 28, 2011]
/* col1 */
table.pme-main th,
table.pme-main td {text-align: center; width: 68px;}
/* col2 */
table.pme-main th+th,
table.pme-main td+td {text-align: right; width: 50px;}
Adjacent sibling selectors have the following syntax: E1 + E2, where E2 is the subject of the selector. The selector matches if E1 and E2 share the same parent in the document tree and E1 immediately precedes E2,
table.pme-main bit means that I'm only selecting elements within a table with that class name, so that's where I stop the code parsers from having to look at matching any more elements.. that way confirming that anything prefixed with that bit of CSS is narrowed to the rendering of this particular table only table.pme-main th,
table.pme-main td
table.pme-main th+th,
table.pme-main td+td
table.pme-main tr.yourclass td+td {}
table.pme-main input {width: 100%; display: block;} .pme-query,
.pme-header,
.pme-filter;{
width: 60px;
}
<input type="submit" class="pme-hide" name="PME_sys_sw" value="Hide">
<input type="submit" class="pme-clear" name="PME_sys_sw" value="Clear">
<input type="submit" class="pme-query" name="PME_sys_filter" value="Search">
table.pme-main part of the selector to get it to overrule the first default rule