Beispiel:CSS2 border-spacing.html

Aus SELFHTML-Wiki
Wechseln zu: Navigation, Suche
<!DOCTYPE html>
<html lang="de">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link rel="stylesheet" media="screen" href="./Beispiel:SELFHTML-Beispiel-Grundlayout.css" />
	<title>Tabellen mit border-spacing</title>
	<style>
table, th, td {
	border: thin solid gainsboro;
}
#bsp1 {
	border-collapse: separate;
	border-spacing: 10px;
	margin-bottom: 2em; /* Abstand zur nächsten Tabelle */
}
#bsp2 {
	border-collapse: separate;
	border-spacing: 50px 10px;
}
</style>
</head>
<body>
	<h1>Tabellen mit border-spacing</h1>

	<table id="bsp1">
		<caption><code>border-spacing:10px;</code></caption>
		<tbody>
			<tr>
				<td>eins</td>
				<td>zwei</td>
			</tr>
			<tr>
				<td>drei</td>
				<td>vier</td>
			</tr>
		</tbody>
	</table>
	<table id="bsp2">
		<caption><code>border-spacing:50px 10px;</code></caption>
		<tbody>
			<tr>
				<td>fünf</td>
				<td>sechs</td>
			</tr>
			<tr>
				<td>sieben</td>
				<td>acht</td>
			</tr>
		</tbody>
	</table>

</body>
</html>