我有桌子,第二列是120像素宽。我希望第一列的宽度是剩下的100%(100%-120px),但是在android上我不能使用CALC
函数。来源:http://caniuse.com/calc
HTML格式:
<table>
<tr>
<td class="one">data</td>
<td class="two">data</td>
<tr>
<table>
CSS:
.one { width: calc(100%-120px); }
.two { width: 120px; }
问题:
如何替换
calc(100%-120px)
以便在android上工作?注:(我不知道宽度100%)
最佳答案
只需不在.one
上设置宽度,或将其设置为auto
,然后将父表设置为100%
。这将导致带有.one
的td填充表的剩余空间。
FIDDLE
<table>
<tr>
<td class="one">data</td>
<td class="two">data</td>
<tr>
<table>
CSS
table {
width: 100%;
}
.one {
background-color: red;
}
.two {
background-color: orange;
width: 120px;
}