Und*_*ion 5 html css safari html-table calc
我找不到有关此错误的任何信息,但看起来像是一个非常严重的错误。
使用calc()和混合百分比值和绝对值来设置<th>表格的宽度时table-layout:fixed,Safari 9会将值计算为-2px。如果所有值均为百分比或所有值均为像素,则效果很好,但将两者始终混合会得出的结果-2px。
有没有解决此问题的方法,该问题是否记录在任何地方?
/* Table */
table {
table-layout: fixed;
width: 100%;
-webkit-border-horizontal-spacing: 0;
-webkit-border-vertical-spacing: 0;
}
th {
color: white;
}
th:first-child {
/* width: calc(50%); works */
/* width: calc(50% - 10%); works*/
/* width: calc(400px - 100px); works*/
width: calc(50% - 25px); /* calculates result of -2px */
background: red;
}
th:last-child {
background: blue;
}Run Code Online (Sandbox Code Playgroud)
<table>
<thead>
<tr>
<th>First</th>
<th>Last</th>
</tr>
</thead>
</table>Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
228 次 |
| 最近记录: |