I have the following code :
相关标签: 5条回答 小蘑菇 2021-01-11 15:47 What you need is just css display inline code, which can be use to format your button form { display: inline; } this displays an element as an inline element like span 0 讨论(0) 发布评论: 提交评论 加载中... 故里飘歌 2021-01-11 15:53 Please see how to use <table> tag inside in <td> and get all button in line. <table> <td> <table> <tr> <td> <button class="btn btn-primary btn-xs">Add</button> </td> <td> <button class="btn btn-primary btn-xs">Edit</button> </td> <td> <button class="btn btn-primary btn-xs">View</button> </td> </tr> </table> </td> </table> 0 讨论(0) 发布评论: 提交评论 加载中... 执笔经年 2021-01-11 15:55 If you're using Bootstrap, try using classes like "pull-left". This will float both of the buttons left and bring them inline. Also check to be sure nothing is overriding the current display attribute. <div class="pull-left">...</div> <div class="pull-right">...</div> 0 讨论(0) 发布评论: 提交评论 加载中... 伪装坚强ぢ 2021-01-11 16:05 Did you tried display: inline-block;? However that seems unnecessary because two buttons in the same table cell will appear on the same line. table, td, tr { border: 1px solid black; border-collapse: collapse; } <table> <tr> <td> <button>Button1</button> <button>Button2</button> </td> </tr> </table> 0 讨论(0) 发布评论: 提交评论 加载中... 天涯浪人 2021-01-11 16:07 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> 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'>. 0 讨论(0) 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
What you need is just css display inline code, which can be use to format your button form { display: inline; }
form { display: inline; }
this displays an element as an inline element like span
Please see how to use <table> tag inside in <td> and get all button in line.
<table>
<td>
<table> <td> <table> <tr> <td> <button class="btn btn-primary btn-xs">Add</button> </td> <td> <button class="btn btn-primary btn-xs">Edit</button> </td> <td> <button class="btn btn-primary btn-xs">View</button> </td> </tr> </table> </td> </table>
If you're using Bootstrap, try using classes like "pull-left". This will float both of the buttons left and bring them inline. Also check to be sure nothing is overriding the current display attribute.
<div class="pull-left">...</div> <div class="pull-right">...</div>
Did you tried display: inline-block;? However that seems unnecessary because two buttons in the same table cell will appear on the same line.
display: inline-block;
table, td, tr { border: 1px solid black; border-collapse: collapse; }
<table> <tr> <td> <button>Button1</button> <button>Button2</button> </td> </tr> </table>
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>
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'>.
inline-block
<td style='white-space: nowrap'>