我有一个带有 3 个操作按钮的表格,我希望"销毁"按钮紧挨着其余按钮,但它被放置在其他两个按钮下,我该如何解决?
<table class="table">
<thead>
<tr>
<th class="text-center">Publishing Date</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
@foreach($books as $book)
<tr>
<td class="text-center">{{$book->fec_pub}}</td>
<td class="td-actions text-center">
<a href="/books/show" type="button" class="btn btn-info">
<i class="material-icons">remove_red_eye</i>
</a>
<a href="/books/{{$book->id}}/edit" title="Edit" class="btn btn-success">
<i class="material-icons">edit</i>
</a>
{!! Form::open(['route'=> ['books.destroy', $book->id], 'method'=>'DELETE']) !!}
{!! Form::button('<i class="material-icons">close</i>', ['type' => 'submit','class' => 'btn btn-danger']) !!}
{!! Form::close() !!}
</td>
</tr>
@endforeach
</tbody>
</table>
{!! Form::open
生成的<form>
的默认显示为block
。您需要将display: inline-block
样式添加到窗体中,以便按钮位于其他按钮旁边。
这也可以通过d-inline-block
Bootstrap 4类来完成。