开发者

Hide text that goes beyond width of TD

开发者 https://www.devze.com 2023-04-03 10:57 出处:网络
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

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

精彩评论

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