CSS超过指定的宽度加省略号

/*table-layout:fixed 会使表格均等分*/
#TreeView1 table
        {
            width:290px;
            table-layout: fixed;
        }
#TreeView1 td:first-child {
    width:8%;
}

/*+选择下一个兄弟节点 注意+前后都有空格*/
#TreeView1 td:first-child + td {
    width:6%;
}

/*[attribute]含有某个属性的元素*/
#TreeView1 td[class] {
    width:80%;
    text-align:left;
}

/*下面的才是重点*/
      #TreeView1  td.node
        {

            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

table-layout:fixed会使表格均等分,不过不用紧张,可以使用选择器来调每一列的高度

http://www.w3school.com.cn/cssref/css_selectors.asp

特别对于IE8尽可能使用css2的选择器去控制

原文地址:https://www.cnblogs.com/lzhp/p/3838304.html