Rather than using table-layout: fixed; for your table, you can use this trick to get a DIV to always take up the full space of a TD with text-overflow: ellipsis; functionality:
div { width: 0; min-width: 100%; }
The main trick is giving the width something other than auto/percent, and using a min-width of 100%;
The table can be fluid sized or fixed width. Just give some min-widths for contents as needed.
<tableclass="myTable"><tr><tdclass="td1"><div>Very very very long text Very very very long text Very very very long text Very very very long text</div></td><tdclass="td2"><div>Content 2</div></td><tdclass="td3"><div>Content 3 also so very lonnnnngggg</div></td></tr></table><tableclass="myTable"><tr><tdclass="td4"><div>Very very very long text Very very very long text Very very very long text Very very very long text</div></td><tdclass="td5"><div>Content 2 has very very very many texts in a very very very long way</div></td><tdclass="td6"><div>Content 3</div></td></tr></table>
Post a Comment for "Fluid Table With Td Nowrap & Text-overflow?"