<div class="container">
<table>
<caption><small>Table width is set to 814px. The sum of widths of the columns is less than the table width, so the remaining space is distributed evenly over the columns.</small></caption>
<tr>
<td class="col-1">The width of this column is set to 200px.</td>
<td class="col-2">The width of this column is set to 300px.</td>
</tr>
<tr>
<td>content of third cell</td>
<td>content four</td>
</tr>
</table>
</div>
<div class="container container-2">
<table>
<caption><small>Table width is set to 814px. The sum of widths of the columns is greater than the table width, so the table will expand to the sum of the widths.</small></caption>
<tr>
<td class="col-1">The width of this column is set to 600px.</td>
<td class="col-2">The width of this column is set to 300px.</td>
</tr>
<tr>
<td>content of third cell</td>
<td>content four</td>
</tr>
</table>
</div>
@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700,900);
body {
background-color: #f5f5f5;
color: #555;
font-size: 1.1em;
font-family: 'Lato', sans-serif;
}
.container {
margin: 40px auto;
width: 800px;
}
table,
td,
th {
padding: 1em;
border: 1px solid #ddd;
text-align: left;
}
table {
table-layout: fixed;
width: 814px;
background-color: white;
}
caption {
caption-side: bottom;
font-style: italic;
}
.col-1 {
width: 200px;
}
.col-2 {
width: 300px;
}
.container-2 .col-1 {
width: 600px;
}
.container-2 .col-2 {
width: 300px;
}