jquery - 数据表内联问题,我想在一行中显示所有操作。请看图片

标签 jquery css laravel-5 datatables

我遇到了内联数据表的问题,我想在一行中显示我的所有操作。我试过内联 CSS 但没有结果。如果可能的话请帮忙,我附上数据表的图片和我的代码。谢谢

这是我的代码,其中我使用 foreach 循环以表格形式显示来自 Controller 的所有数据,问题出在最后一个 <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>

Datatables pic

最佳答案

在有按钮的 td 中添加 nowrap。并给它们一些宽度。

<td style="display:inline"  nowrap>

关于jquery - 数据表内联问题,我想在一行中显示所有操作。请看图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52748867/

相关文章:

javascript - 通过覆盖转发和嗅探事件

javascript - 自定义样式的选择框

asp.net - 超过 body 宽度的物体

ios - 固定计算和位置的最小高度不适用于移动设备

html - 搜索框内的搜索按钮

laravel - 使用条件仅为 Laravel Controller 中的管理员用户获取数据

jquery - 更改时验证所选的选择菜单

javascript - PHP laravel 5 以输入名称作为键的验证错误

laravel - Laravel 5.x 中 onUpdate/onDelete 的可用操作

javascript 加载的 img 仍然有 0 高度