Skip to content

Instantly share code, notes, and snippets.

@jmuheim
Created August 23, 2012 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmuheim/3436567 to your computer and use it in GitHub Desktop.
Save jmuheim/3436567 to your computer and use it in GitHub Desktop.
Tables with white-space:nowrap, overflow:hidden, text-overflow:ellipsis that do not need table-layout:fixed
<html>
<head>
<style type="text/css" media="screen">
table {
width: 100%;
table-layout: fixed;
border-collapse: collapse;
}
table th, table td {
padding: 5px 8px;
font-size: 1.2em;
border-bottom: 1px solid #999;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
table th {
background: #eee;
font-weight: bold;
text-align: left;
}
table td {
border-bottom: 1px solid #ccc;
}
table td {
font-size: 18px;
}
td span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis
}
</style>
</head>
<body>
<table cellpadding="0" cellspacing="0" id="dataTable">
<tbody>
<tr>
<th>Nr.</th>
<th>Prioritaet</th>
<th>Erledigt</th>
<th>Kategorie</th>
<th><span>Betreff</span></th>
<th>An</th>
<th>Beginnt am</th>
<th>Faellig am</th>
</tr>
<tr>
<td>1252</td>
<td>Hoch</td>
<td>Nein</td>
<td>to_do</td>
<td>Offerte von H. Mustermann AG</td>
<td>Frederic Merc</td>
<td>2012-08-03 19:32</td>
<td>2012-08-10 19:32</td>
</tr>
</tbody>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment