使用 >
我正在尝试使用 设置比例列宽度:
<table width="600px">
<col width="1*" />
<col width="2*" />
<col width="3*" />
<tbody>
<tr>
<td style="border: 1px solid black;">AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA
</td>
<td style="border: 1px solid black;">BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB
</td>
<td style="border: 1px solid black;">CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC
</td>
</tr>
</tbody>
</table>
尽管在 标记中设置比例,但列宽度相等。我做错了什么?
I am trying to set proportional column width with <col width="x*" />
:
<table width="600px">
<col width="1*" />
<col width="2*" />
<col width="3*" />
<tbody>
<tr>
<td style="border: 1px solid black;">AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA AAA
</td>
<td style="border: 1px solid black;">BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB BBB
</td>
<td style="border: 1px solid black;">CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC CCC
</td>
</tr>
</tbody>
</table>
Despite setting proportions in <col>
tag, column widths are equal. What do I do wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用 17%、34% 和 49%。 1:2:3
you could use 17%, 34%, and 49%. for 1:2:3
我试图让它在所有主要浏览器中工作,但也失败了。除了官方规范之外,谷歌几乎没有透露什么。
我的结论是,任何浏览器制造商都不支持比例列宽。非常奇怪,因为与当今支持的一些更深奥的东西相比,它看起来非常有用。
I tried to get this to work in all the major browsers but have also failed. Google brings up very little except the official spec.
I conclude that proportional column width simply isn't supported by any of the browser makers. Very odd, since it would seem very useful compared to some of the more esoteric stuff that is supported nowadays.
您可以使用
colgroup
。来自WSSchools
You can use
colgroup
.From WSSchools