diff --git a/src/components/slides/html-tables/advanced.astro b/src/components/slides/html-tables/advanced.astro
index 7f6a689..1667058 100644
--- a/src/components/slides/html-tables/advanced.astro
+++ b/src/components/slides/html-tables/advanced.astro
@@ -8,4 +8,125 @@
Neben table,tr
und td
, gibt es auch Tags um eine Tabelle etwas besser zu strukturieren
thead
für die Kopfzeilentbody
für den eigentlichen Inhalttfoot
für FußzeilenArtikel | +Preis | +Menge | +
---|---|---|
Summe | +7,97€ | +|
Honig | +1,99€ | +2 | +
Butter | +3,99€ | +1 | +
+ <table>
+ <thead>
+ <tr>
+ <th>Artikel</th>
+ <th>Preis</th>
+ <th>Menge</th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td colspan="2">Summe</td>
+ <td>7,97€</td>
+ </tr>
+ </tfoot>
+ <tbody>
+ <tr>
+ <td>Honig</td>
+ <td>1,99€</td>
+ <td>2</td>
+ </tr>
+ <tr>
+ <td>Butter</td>
+ <td>3,99€</td>
+ <td>1</td>
+ </tr>
+ </tbody>
+ </table>
+
+ Natürlich ist es auch möglich, eine bestimmte Zelle als "Header" zu deklarieren
+In solchen Situationen empfiehlt es sich, auch das attribut scope
auf "row"
zu setzen.
+ <table>
+ <tr>
+ <th>Film</th>
+ <th>Bewertung</th>
+ </tr>
+ <tr>
+ <th scope="row">Matrix</th>
+ <td>★★★★★</td>
+ </tr>
+ <tr>
+ <th scope="row">Matrix Revolution</th>
+ <td>★★★</td>
+ </tr>
+ </table>
+
+ Film | +Bewertung | +
---|---|
Matrix | +★★★★★ | +
Matrix Revolution | +★★★ | +
Das scope
Attribut hilft Screenreadern.
Zu guter letzt:
+Es können Tabellen in Tabellen geschachtelt werden
+Mithilfe des colspan
-Attributes kann man festlegen, wie viele Spalten die Zelle einnehmen soll
Der gleiche Effekt kann für Zeilen mittels rowspan
erreicht werden.
Hersteller | +Name | +Bewertung | +
---|---|---|
Bandai Namco | +Dark Souls | +89 | +
Dark Souls 2 | +91 | +|
Dark Souls 3 | +89 | +|
Elden Ring | +96 | +|
Larian Games | +Baldur's Gate 3 | +96 | +
Electronic Arts | +Dark Space (Remake) | +89 | +
Dead Space 2 | +90 | +|
Dead Space 3 | +78 | +