我正在尝试缩短某个表格中列的长度。
我使用一些jQuery添加了文本溢出省略号和其他一些css属性。
我还使用了更多的jQuery来添加工具提示。
以下是我的代码:
$('#table_id tr td:not(:last)').css({
"text-overflow": "ellipsis",
"max-width": "110px",
"overflow": "hidden",
"display" : "block"
}).each(function (index, element) { $(element).attr("title", $(element).text()); });
在Firefox和Chrome中一切都正常,但是(惊喜!惊喜!)IE7-9渲染文本的全长。
您有什么想法是我做错了什么吗? 谢谢!
P.S.
我也尝试过指定“width”属性,但无济于事。
white-space: nowrap
和width:100%
。 - rcode