div に to-columns テーブルがあります:
<div>
<table>
<tbody>
<tr>
<td class="action" >
<a> ✔ </a>
</td>
<td class="content">
<p>Bigger text...(variable size).......</p>
</td>
</tr>
<tr>
<td class="action" >
<a> ✔ </a><a> ✘ </a>
</td>
<td class="content">
<p>Bigger text...(variable size).......</p>
</td>
</tr>
... same structure in all the table
</tbody>
</table>
</div>
そして、「アクション」列をコンテンツに合わせて、「コンテンツ」列が残りのスペースを占めるようにしたいと思います。「アクション」列は、右揃えの方が見栄えがします。また、テーブルはコンテナーの幅の 100% に収まる必要があります。
列幅を固定せずにこれを行う方法はありますか?
私はこれで試しました:
table .action
{
width:auto;
text-align:right;
}
table
{
border-collapse:collapse;
border-spacing:0;
width:100%;
}
しかし、左の列はテーブルの半分を占めています...