在table中使用溢出样式,table样式要设置为”table-layout: fixed“,即<table style="table-layout: fixed;">,溢出样式才有效果

        table tbody tr td
        {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

注释:

white-space:nowrap;表示文本不会换行,在同一行继续,知道遇到<br>标签为止;

overflow:hidden;不显示超过对象尺寸的内容,就是把超出的部分隐藏了;

text-overflow:ellipsis;当文本对象溢出是显示...,当然也可是设置属性为clip不显示点点点;

 

程序员的基础教程:菜鸟程序员

posted on 2015-07-08 12:02  itprobie-菜鸟程序员  阅读(589)  评论(0编辑  收藏  举报