Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 第一<;th>;尽可能宽,最大百分比宽度,所有其他<;th>;不包装_Html_Css - Fatal编程技术网

Html 第一<;th>;尽可能宽,最大百分比宽度,所有其他<;th>;不包装

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>

考虑以下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>
        <!-- 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 |   |
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯