moderne CSS3-Selektoren an einer Tabelle angewendet
Es soll nicht die erste und nicht die letzte Tabellenzelle selektiert werden. Offenbar gilt das aber pro Zeile, nicht pro Tabelle.
HTML
<table>
<thead>
<tr>
<th>Hallo Herr weber </th>
<th>und wie gehts ihn ?</th>
<th>Gut? mir auch</th>
<th>Tipp GEBEN sie mir eine 1!</th>
</tr>
</thead>
<tbody>
<tr>
<td>Ich muss sagen das war ganz einfach </td>
<td>nunja ich weiß nicht mehr was ich schreiben soll ^^</td>
<td>?????????????????
</td>
<td>??????????????</td>
</tr>
</tbody>
</table>
<h1>***********</h1>
<p id= Hallo> Hallo </p>
<p>
Text davor
</p>
<p style="visibility: hidden;" id="example">
Text innerhalb
</p>
<p>
Text dannach
</p>
<p>
CSS
tr:first-of-type td:not(:first-of-type),tr:not(:first-of-type):not(:last-of-type) td, tr:last-of-type td:not(:last-of-type){background: red}
// Einfach mal hübsch machen mit einem YAML4-Standard-Style
table{width:100%;border-collapse:collapse;margin:1.3571em 0 0 0;color:#333;border-top:1px #ccc solid;border-bottom:1px #ccc solid;}
table caption{font-variant:small-caps;}
th,td{line-height:1.5em;vertical-align:top;padding:0.7143em 0.5em;}
th *:first-child,
td *:first-child{margin-top:0;}
th.nowrap,
td.nowrap{white-space:nowrap;}
thead th{text-align:left;color:#000;border-bottom:2px #000 solid;}
tbody th{text-align:left;border-top:1px solid #ccc;text-align:left;}
tbody td{text-align:left;border-top:1px solid #ccc;}
tbody tr:hover th,
tbody tr:hover td{background:#f8f8f8;color: #000;font-weight: normal;}
JavaScript
$('#main h3').click(function() {
$(this).next('div').siblings('.child').slideUp(3000);
$(this).next('.child').slideDown(3000);
});