0
即使数据集中的单个词太长而无法容纳,我也希望列具有指定的宽度。但break-word
似乎只在与table-layout: fixed
结合使用时才起作用,而后者是唯一的我知道的方式使列宽具体值...表格布局和分词冲突? (HTML,CSS)
有没有解决此问题的方法?也许是一种JavaScript方式?
请参阅的jsfiddle here
table {
white-space: pre-wrap;
word-wrap: break-word;
width: 350px;
text-align: left;
vertical-align: top;
table-layout: fixed;
background-color: lightblue;
color: red;
font-Weight:400;
border-radius: 5px;
}
td {
color: black;
}
#colopmerking {
width: 200px;
}
#colbestanden {
width: 100px;
}
#coldoor {
width: 50px;
}