場景:
最左邊這欄我不行讓他換行,怎麼辦呢?
下面是解決辦法:
- table{
- width:100px;
- table-layout:fixed;/* 只有定義了表格的佈局算法爲fixed,下面td的定義才能起作用。 */
- }
- td{
- width:100%;
- word-break:keep-all;/* 不換行 */
- white-space:nowrap;/* 不換行 */
- overflow:hidden;/* 內容超出寬度時隱藏超出部分的內容 */
- text-overflow:ellipsis;/* 當對象內文本溢出時顯示省略標記(...) ;需與overflow:hidden;一起使用*/
- }
參考:http://www.52design.com/html/201007/design201071123721.shtml
現在: