I have a table with fixed layout. On overflow, the contents of cells should clip from the left instead of the right. That is, if the width of the TD is less than the width of the text, the cell below should display "67890" instead of "12345".
This needs to work in IE7+ at minimum. Is there a way开发者_运维问答 to do this in css without any JavaScript?
<table style="table-layout:fixed">
<tr>
<TD>
12334567890
</TD>
</tr>
</table>
you could use:
direction:rtl;
I haven´t tried it, but you could try text-align:right
or wrap the contents in a div
and float that right.
You can use the CSS3 property word-wrap: break-word
but there's no way to control where it will break the word. It will fit whatever it can on the line and then break it down to the next, it won't keep the lines of equal length.
There is also the <wbr>
tag but I've never used or experimented with it, so I can't really tell you how to use it.
精彩评论