|
|||
Bestimmte Zeilenlinien bei einer Tabelle anzeigen
Hallo,
ich würde gerne bei einer HTML-Tabelle nur bestimmte Linien anzeigen. Wie könnte man das machen? Z.B. hat eine Tabelle 4 Zeilen. Ich möchte dann, dass in der letzten Zeile die obere Linie angezeigt wird. Ich habe es mit Code:
border: thin solid #a0a0a0; border-top-width: medium; |
Sponsored Links |
|
|||
Das kommt auf deinen HTML-Quelltext und das restliche CSS an, die wir nicht kennen.
Dein CSS ist korrekt und funktioniert richtig angewendet. Ein Beispiel: Code:
<!DOCTYPE html> <html lang="de"> <head> <meta charset="utf-8"> <title>Tabelle</title> <meta name="description" content="HTML5, CSS3"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> @media all { * { box-sizing: border-box; } html { font-size: 120%; } } /*Grundeinstellungen für Tabellen*/ @media all { table { /*Zell-Zwischenräume-Standard-Werte:; border-collapse: separate; border-spacing: 2px;*/ border-collapse: separate; /*Zellzwischenräume*/ border-collapse: collapse; /*keine Zell-Zwischenräume*/ } th, td { text-align: left; vertical-align: top; padding: 0.3rem 0.7rem; } } /*Spezielle Einstellungen für diese Tabelle*/ @media all { tbody tr:last-child{ border: thin solid #a0a0a0; border-top-width: medium; } } </style> </head> <body> <main> <table> <thead> <tr> <th></th> <th>Banane</th> <th>Orange</th> <th>Kiwi</th> <th>Erdbeere</th> <th>Mandarine</th> <th>Mango</th> </tr> </thead> <tbody> <tr> <th>VW</th> <td>0101</td> <td>0102</td> <td>0103</td> <td>0104</td> <td>0105</td> <td>0106</td> </tr> <tr> <th>Mercedes</th> <td>0201</td> <td>0202</td> <td>0203</td> <td>0204</td> <td>0205</td> <td>0206</td> </tr> <tr> <th>Audi</th> <td>0301</td> <td>0302</td> <td>0303</td> <td>0304</td> <td>0305</td> <td>0306</td> </tr> <tr> <th>BMW</th> <td>0401</td> <td>0402</td> <td>0403</td> <td>0404</td> <td>0405</td> <td>0406</td> </tr> </tbody> </table> </main> </body> </html> Geändert von MrMurphy (07.12.2020 um 14:29 Uhr) |
Sponsored Links |
Themen-Optionen | |
Ansicht | |
|
|
Ähnliche Themen | ||||
Thema | Autor | Forum | Antworten | Letzter Beitrag |
Bilder im html mit Placeholder bestimmte Male anzeigen? | Killaoptik | (X)HTML | 1 | 29.05.2012 17:12 |
externe Seite in Tabelle anzeigen | vipersgarden | CSS | 10 | 31.03.2009 13:38 |
geschachtelte Tabelle oder wie Master-Detail anzeigen? | tesa | (X)HTML | 5 | 22.03.2009 20:30 |
tabelle nur oberen rand anzeigen | bl3nder | CSS | 6 | 05.09.2007 11:47 |
Tabelle - bestimmte Spalte aussehen definieren | krakos | CSS | 1 | 24.05.2006 05:59 |