【发布时间】:2020-03-31 22:14:27
【问题描述】:
我在 HTML 中有以下问题。
我的这张表只包含一个标题:
<table border="1" class="table_legenda" width="100%">
<thead>
<tr>
<th width="8.33%">Codice</th>
<th width="2%">Stato</th>
<th width="8.33%">Creazione<</th>
<th width="8.33%">Registrazione</th>
<th width="6.33%">Autore Cr</th>
<th width="6.33%">Autore Con</th>
<th width="6.33%">Autore Acq</th>
<th width="8.33%">Totale Imponibile</th>
<th width="24.66%">Fornitore</th>
<th width="4.33%">RM riserva</th>
<th width="8.33%">Errore</th>
<th width="8.33%">Azione</th>
</tr>
</thead>
</table>
现在,如您所见,每个单元格都设置了百分比宽度并包含文本值。
我的问题是,如果单元格的文本值长于单元格的可用空间,它将自动隐藏。我希望文本自动换行。
如何才能获得这种行为?
Tnx
【问题讨论】:
-
你的意思是这样? - jsfiddle.net/js1zjm0x
-
发布的代码不会导致文本被隐藏。相反,列设置得足够宽。
width设置与建议的最小宽度一样。除非您以某种方式阻止它,否则文本会在需要时自动在单词之间换行。请发布一个实际演示问题的案例,并解释您认为允许的换行符。 (单词之间?带有连字符的单词内部?野蛮地在任意点?)
标签: html css xhtml html-table