Specifying the Table Layout
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
<style>
table {
border-collapse: collapse;
caption-side: bottom;
table-layout: fixed;
width: 100%;
}
th, td {
padding: 5px;
}
</style>
</head>
<body>
<table border="1">
<caption>A caption</caption>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
</table>
</body>
</html>
Home
HTML CSS Book
CSS
HTML CSS Book
CSS
Table Style:
- Styling Tables
- Configuring Separated Borders
- Dealing with Empty Cells
- Positioning the Caption
- Specifying the Table Layout
Related: