2014-11-03 12 views
0

我試圖設置兩列的固定寬度:使列的寬度固定,敷字下一行

.thkqgiai{ 
    width:20% !important; 
} 

.thkqso{ 
    width:80% !important; 
} 

.tdkqgiai{ 
    text-align:center; 
} 

.tdkqso{ 
    text-align:center; 
    word-wrap:break-word !important; 
} 

thkqgiaitdkqgiai是第一列的thtd類分別

thkqsotdkqso分別是第二列的thtd類別

如何使列的寬度保持不變,長文本將換行到下一行?

enter image description here

回答

1

只要您需要申請固定表格的佈局:

table{ 
    table-layout: fixed; 
} 

默認情況下表格的佈局是汽車。