开发者

Hide text that goes beyond width of TD

I have a TD with a fixed width in pixels. Despite the w开发者_运维百科idth of the TD being set, and the following css applied to the TD, my text is going beyond the width of the TD (I don't want the text to wrap), whereas, I want anything beyond the width of the TD to be hidden.

Here is the CSS I have in place at the moment:

td { overflow:hidden; white-space:nowrap; width:100px !important; }


You need to wrap everything inside the td in a div, and give that the same rules.

td, div { overflow:hidden; white-space:nowrap; width:100px !important; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜