關鍵樣式:
table-layout:fixed 固定布局的算法,則表格被呈遞的默認寬度為 100% (For IE,Mozilla)
text-overflow:ellipsis 當對象內文本溢出時顯示省略標記(...) (For IE)
overflow:hidden 不顯示超過對象尺寸的內容 (For IE,Mozilla)
white-space: nowrap 強制在同一行內顯示所有文本,直到文本結束或者遭遇 br 對象 (For IE,Mozilla)
.ctl{
table-layout:fixed
}
.ctl td{text-overflow:ellipsis;overflow:hidden;white-space: nowrap;padding:2px}
<table cellSpacing="0" cellpadding="1" width="100" class="ctl" border=1>
即可使用