HTML Tabellenrahmen
Wie kann ich einen Rahmen um die Tabelle herumstellen?
Erklärung
Tabelle mit Rahmen
Um alles klarer zu machen, werden wir einen Rahmen an der Tabelle stellen mit dem "border" Attribut.
Dieses Attribut sollte in das "table" Tag hinzugefügt werden.
Beispiel
Example Code
<table border=1>
<tr>
<td>
This is first column
</td>
<td>
This is second column
</td>
</tr>
</table>
Ergebnis: Das Ergebnis für dieses Tag wird das folgende:
This is first column | This is second column |
Tabelle mit 2 Zeilen und 2 Spalten
Jetzt werden wird versuchen, eine Tabelle mit 2 Spalten und 2 Zeilen
Beispiel
Example Code
<table border=1>
<tr>
<td>
This is 1st row 1st column
</td>
<td>
This is 1st row 2nd column
</td>
</tr>
<tr>
<td>
This is 2nd row 1st column
</td>
<td>
This is 2nd row 2nd column
</td>
</tr>
</table>
Ergebnis:Das Ergebnis für dieses Tag wird das folgende
This is 1st row 1st column | This is 1st row 2nd column |
This is 2nd row 1st column | This is 2nd row 2nd column |