HTML <table> cellspacingAttribut
Beispiele
Legen Sie den cellspacing-Wert der Tabelle auf 10 Pixel fest:
<table border="1" cellspacing="10">
<tr>
<th>Monat</th>
<th>Ersparnisse</th>
</tr>
<tr>
<td>Januar</td>
<td>$100</td>
</tr>
</table>
Selbst ausprobieren »
Browser-Unterstützung
![]()
![]()
![]()
![]()
![]()
Alle gängigen Browser unterstützen das cellspacing-Attribut.
Definition und Verwendung
HTML5 unterstützt das cellspacing-Attribut von <table> nicht.
Das cellspacing-Attribut gibt den Abstand zwischen Zellen in Pixeln an. Wenn dieses Attribut nicht gesetzt ist, ist sein Standardwertcellspacing="2"。
Hinweis:⟦⟧Verwechseln Sie dieses Attribut nicht mitDo not confuse this attribute with cellpaddingdem Zellenattribut. Das cellpadding-Attribut gibt den Abstand zwischen dem Zellenrand und dem Zelleninhalt an.
Syntax
<table cellspacing="pixels">
Attributwerte
| Wert | Beschreibung |
|---|---|
| pixels | Gibt den Abstand zwischen Zellen an. |
HTML <table> Tag Weitere Erweiterungen