Skip to content

Instantly share code, notes, and snippets.

@oksushi
Created July 24, 2012 00:42
Show Gist options
  • Save oksushi/3167203 to your computer and use it in GitHub Desktop.
Save oksushi/3167203 to your computer and use it in GitHub Desktop.
Table with varying widths
/**
* Table with varying widths
*/
table {
width: 100%;
border: 1px solid hotpink;
border-collapse: collapse;
table-layout: fixed;
border-spacing: 1em;
}
td,
th {
width: 100px;
border: 1px solid lime;
text-align: left;
}
td:nth-child(3),
th:nth-child(3),
td:nth-child(5),
th:nth-child(5){
width: auto;
}
<table>
<tr>
<th>Item</th>
<th>Item</th>
<th>Item</th>
<th>Item</th>
<th>Item</th>
</tr>
<tr>
<td>Thing</td>
<td>Thing</td>
<td>Thing</td>
<td>Thing</td>
<td>Thing</td>
</tr>
</table>
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment