Table Tr TD的自動換行

1 <style type="text/css"> 2 table { 3 width: 30em; 4 table-layout: fixed; /* 只有定義了表格的布局算法為fixed,下面td的定義才能起作用。 */ 5 } 6 7 table td { 8 width: 100%; 9 word-break: keep-all; /* 不換行 */ 10 white-space: nowrap; /* 不換行 */ 11 overflow: hidden; /* 內容超出寬度時隱藏超出部分的內容 */ 12 text-overflow: ellipsis; /* 當對象內文本溢出時顯示省略標記(...) ;需與overflow:hidden;一起使用。*/ 13 } 14 </style>
其他的換行參照類似