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会使表格均等分,不过不用紧张,可使用选择器来调每一列的高度css

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

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

相关文章
相关标签/搜索