我是 HTML 和 CSS 的新手,我遇到了水平扩展问题,而我希望它垂直扩展。我已经固定了 Th 的宽度,但它没有解决任何问题。这是我的代码。
<div id="resBox">
<table id="resTable">
<tr>
<th class="frame">a</th>
<th class="frame">b</th>
<th class="frame">c</th>
<th class="frame">d</th>
<th class="frame">e</th>
</tr>
</table>
</div>
每当一个 th 包含一个长字符串时,它就会使其他帧变小。
这是CSS代码:
#resTable{
width:100%;
margin:auto;}
.frame{
width:19%;
border: 1px solid black;}
谢谢。
最佳答案
没有明确的方法可以在不涉及可以生成子字符串的某种形式的代码背后或类似代码的情况下执行此操作,这适用于长的连续字符串。
您得到的最接近的内容类似于本文中解释的内容:
http://www.cs.tut.fi/~jkorpela/html/nobr.html
但是这些方法可能会出现过多错误。
关于html - 垂直扩展台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10981811/