Html 第一<;th>;尽可能宽,最大百分比宽度,所有其他<;th>;不包装
考虑以下HTML表:Html 第一<;th>;尽可能宽,最大百分比宽度,所有其他<;th>;不包装,html,css,Html,Css,考虑以下HTML表: <table> <thead> <th class="col one">One</th> <th class="col two">Two</th> <th class="col three">Three</th> <th class="col four">Four</th>
<table>
<thead>
<th class="col one">One</th>
<th class="col two">Two</th>
<th class="col three">Three</th>
<th class="col four">Four</th>
<!-- Any number of columns follow... -->
</thead>
<tbody>
<!-- content... -->
</tbody>
</table>
坏的:
感谢您的第一个请求,正如@KheemaPandey所说,您应该在CSS中使用
最大宽度:35%
根据您的第二个请求,格式化您不想用
空白:nowrap包装的列
应该可以。你试过
最大宽度:35%
最大宽度
%对我来说在ChromeW3中的列似乎不起作用。学校说它应该起作用:在CSS 2.1中,“最小宽度”和“最大宽度”对表、内联表、表单元格、表列的影响,列组未定义。
和指定用于确定所用值的百分比。百分比是根据生成的框的包含块的宽度计算的。如果包含块的宽度为负,则使用的值为零。如果包含块的宽度取决于此元素的宽度,则结果布局在CSS 2.1中未定义。
根据
<-------------| Max 35% |-------------->
__________________________________________________________________
| One | Two | Three | Four |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
__________________________________________________________________
| | T | T | F |
| | w | h | o |
| One | o | r | u |
| | | e | r |
| | | e | |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯