i have tried the following code to my td, but no good sign.
.td_class{
max-width:100px;
overflow: hidden;
text-overflow : ellipsis;
-ms-text-overflow : ellipsis;
}
any help?
i have tried the following code to my td, but no good sign.
.td_class{
max-width:100px;
overflow: hidden;
text-overflow : ellipsis;
-ms-text-overflow : ellipsis;
}
any help?
Try this,
td
{
max-width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
It will work, if you wrap the text in the <th>
in an additional element and apply the width
and overflow
to that:
http://jsfiddle.net/nkLav9f7/6/
<table>
<thead>
<tr>
<th><span>This is a really long header</span></th>
</tr>
</thead>
<tbody>
<tr>
<td>foo</td>
</tr>
</tbody>
</table>
table, td { border: solid 1px black }
th
{
max-width: 50px;
}
span
{
overflow: hidden;
display: block;
width: 50px;
white-space: nowrap;
text-overflow: ellipsis;
}
If you have set "word-wrap: bread-word" in other style like "*{word-wrap: bread-word}", please change it to "word:wrap: normal". It works for me.