【发布时间】:2020-07-06 17:44:24
【问题描述】:
我有下表:
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<table class="table table-responsive">
<thead>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
<th>col4</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Pedro</td>
<td>mk-567</td>
<td>
<div class="btn btn-group">
<button type="button" class="btn btn-default btn-xs">
<i class="fa fa-search"></i>
</button>
<button type="button" class="btn btn-default btn-xs">
<i class="fa fa-trash-o"></i>
</button>
</div>
</td>
</tr>
</tbody>
</table>
如您所见,col4 的宽度很大,我尝试设置width:auto 但它不起作用,如果我手动设置宽度,当我更改页面分辨率时,它看起来很糟糕,真的很糟糕。我尝试设置为width: 1px,但按钮不会相互包裹。
有一种方法可以将列“自动调整宽度”到按钮?
【问题讨论】:
-
我不清楚问题是什么。 "col4 has way to much width" 是什么意思?是否希望按钮组展开以填充容器?
-
@j08691 糟糕,自动更正。谢谢指出
-
@j08691 我需要列来调整按钮的总宽度,如果 F.E. 两个按钮的总宽度为 100 像素,我需要列来调整到该宽度。就像我说的那样,我尝试手动设置宽度,但是当分辨率改变时会破坏网络设计
标签: html css twitter-bootstrap-3