Hallo Guenther43,
Nun möchte ich aber die Spaltenbreiten nicht in jeder Tabelle wieder angeben, sondern nur einmal im Seitenkopf, also mit <style type="text/css"> ... ... </style>
Besser in einer ausgelagerten CSS-Ressource.
Wie geht das?
Mithilfe der Pseudoklassen nth-child()
. Wiki
th:first-child, td:first-child {
width: 17%;
}
th:nth-child(2), td:nth-child(2) {
width: 17%;
}
kürzer (nur, wenn es kein script
oder template
als Kind der tr
gibt)
tr > :first-child {
width: 17%;
}
tr > :nth-child(2) {
width: 14%
}
Ggf. brauchst du noch ein table-layout: fixed;
für die Tabelle.
Bis demnächst
Matthias
--
Rosen sind rot.
Rosen sind rot.