jquery - 数据表内联问题,我想在一行中显示所有操作。请看图片
问题描述
我遇到了内联数据表的问题,我想在一行中显示我的所有操作。我尝试了内联 CSS,但没有结果。如果可能,请提供帮助,我附上数据表的图片和我的代码。谢谢
这是我的代码,其中我使用 foreach 循环以表格形式显示来自控制器的所有数据,问题在最后<td>
。
<div class="panel-body table-responsive">
<table class="table table-striped table-bordered" id="table">
<thead>
<tr class="filters">
<th>Voucher#</th>
<th>Created Date</th>
<th>Package</th>
<th>Mautamer's Name</th>
<th>Mautamer's Passport</th>
<th>Created By</th>
<th> Actions </th>
</tr>
</thead>
<tbody>
@foreach($vouchers as $voucher)
<tr>
<td>{{$voucher->id}}</td>
<td >{{$voucher->created_date}}</td>
<td >{{$voucher->package_name}}</td>
<td>{{$voucher->name}}</td>
<td>{{$voucher->passport_no}}</td>
<td>{{$voucher->created_by}}</td>
<td style="display:inline">
<a href="{{route('voucher.show', $voucher->id)}}"> <i class="livicon" data-name="info" data-size="18" data-loop="true" data-c="#428BCA" data-hc="#428BCA" title="view" style='display:inline'></i></a>
<a href="{{route('voucher.edit', $voucher->id)}}"><i class="livicon" data-name="edit" data-size="18" data-loop="true" data-c="#428BCA" data-hc="#428BCA" title="edit " style='display:inline'></i></a>
<form method="{{route('voucher.destroy', $voucher->id)}}" action="" style='display:inline'>
@method('Delete')
<button type="submit"><i class="livicon" data-name="user-remove" data-size="18" data-loop="true" data-c="#f56954" data-hc="#f56954" title="delete"></i></button>
</form>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
解决方案
将 nowrap 添加到具有按钮的 td 中。并给它们一些宽度。
<td style="display:inline" nowrap>
推荐阅读
- google-app-engine - 错误:(gcloud.app.deploy) 错误响应:[3] 将文件复制到 App Engine 时出现以下错误
- pandas - Pandas - 加入两个带有条件的 DataFrame(“介于”条件)
- c++ - 我可以使用与我使用的库不同的 _ITERATOR_DEBUG_LEVEL 链接项目吗?
- c - Flex中文字内的多行匹配
- excel - 这是什么日期格式:YYYYMMDDTHHMISS
- java - 如何将字符数组的元素与字符串的字母进行比较
- ubuntu-16.04 - Openlink Virtuoso 在 ubuntu 16.04 上将 6.x 升级到 7.x
- php - 获取按多对多关系过滤的 Laravel 模型
- html - 图片旁边的文字
- ruby-on-rails - 是否可以直接将此文件保存到 ActiveStorage?