Skip to content

Instantly share code, notes, and snippets.

@ringmaster
Created March 9, 2012 15:29
Show Gist options
  • Save ringmaster/2007022 to your computer and use it in GitHub Desktop.
Save ringmaster/2007022 to your computer and use it in GitHub Desktop.
Table overflow
/**
* Table overflow
*/
#tbl {
width: 300px;
table-layout: fixed;
}
#tbl td {
overflow: hidden;
width: 100px;
white-space: nowrap;
border: 1px solid black;
vertical-align: top;
height: 1em; /* Only makes the cells bigger, doesn't constrain */
}
​<table id="tbl">
<tr>
<td>This is somewhat wide data</td>
<td>This is somewhat wide data<br/>
With a second line</td>
<td>This is somewhat wide data</td>
</tr>
<tr>
<td>This is somewhat wide data</td>
<td>This is somewhat wide data</td>
<td>This is somewhat wide data</td>
</tr>
</table>​​​​​​​​​​​​
{"view":"separate","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment