使表格单元格内的 2 个按钮彼此相邻 [英] Make 2 buttons inside a table cell be next to each other
本文介绍了使表格单元格内的 2 个按钮彼此相邻的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下代码:
<td>
<button class="btn btn-primary btn-xs" ng-click="r.changeView('requests/edit/' + request.id)">
<i class="fa fa-pencil-square-o"></i>
</button>
<button class="btn btn-primary btn-xs" ng-click="r.changeView('requests/edit/' + request.id)">
<i class="fa fa-step-backward"></i>
<i class="fa fa-step-forward"></i>
</button>
</td>
它们出现在 2 条不同的行上.
They appear on 2 different lines.
如何让它们在同一行上并排出现?
How can I make them appear next to each other on the same line ?
我用 float
和 display
尝试了一些东西,但没有成功.
I tried a few things with float
and display
but without success.
推荐答案
如果我在代码片段中添加该代码,按钮彼此相邻,因此很难重现:
If I add that code in a snippet the buttons are next to each other, so it's hard to reproduce:
<table>
<tr>
<td>
<button class="btn btn-primary btn-xs" ng-click="r.changeView('requests/edit/' + request.id)">
<i class="fa fa-pencil-square-o"></i>Button1
</button>
<button class="btn btn-primary btn-xs" ng-click="r.changeView('requests/edit/' + request.id)">
<i class="fa fa-step-backward"></i>
<i class="fa fa-step-forward"></i>Button2
</button>
</td>
</tr>
</table>
按钮已经显示为inline-block
.也许桌子不够宽;如果是这样,您可以尝试 <td style='white-space: nowrap'>
.
The buttons are already displayed as inline-block
.
Maybe the table isn't wide enough; if so, You could try <td style='white-space: nowrap'>
.
这篇关于使表格单元格内的 2 个按钮彼此相邻的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文