|
15 | 15 | @endif |
16 | 16 | </div> |
17 | 17 |
|
18 | | - <div class="card overflow-auto mb-3"> |
| 18 | + <div class="card mb-3"> |
19 | 19 | @if($models->isEmpty()) |
20 | 20 | <div class="card-body"> |
21 | 21 | {{ __('No results to display.') }} |
22 | 22 | </div> |
23 | 23 | @else |
24 | 24 | <div class="card-body p-0"> |
25 | | - <table class="table {{ $table_class }} mb-0"> |
26 | | - <thead class="{{ $thead_class }}"> |
27 | | - <tr> |
28 | | - @if($checkbox && $checkbox_side == 'left') |
29 | | - @include('laravel-livewire-tables::checkbox-all') |
30 | | - @endif |
31 | | - |
32 | | - @foreach($columns as $column) |
33 | | - <th class="align-middle text-nowrap border-top-0 {{ $this->thClass($column->attribute) }}"> |
34 | | - @if($column->sortable) |
35 | | - <span style="cursor: pointer;" wire:click="sort('{{ $column->attribute }}')"> |
36 | | - {{ $column->heading }} |
37 | | - |
38 | | - @if($sort_attribute == $column->attribute) |
39 | | - <i class="fa fa-sort-amount-{{ $sort_direction == 'asc' ? 'up-alt' : 'down' }}"></i> |
40 | | - @else |
41 | | - <i class="fa fa-sort-amount-up-alt" style="opacity: .35;"></i> |
42 | | - @endif |
43 | | - </span> |
44 | | - @else |
45 | | - {{ $column->heading }} |
46 | | - @endif |
47 | | - </th> |
48 | | - @endforeach |
49 | | - |
50 | | - @if($checkbox && $checkbox_side == 'right') |
51 | | - @include('laravel-livewire-tables::checkbox-all') |
52 | | - @endif |
53 | | - </tr> |
54 | | - </thead> |
55 | | - <tbody> |
56 | | - @foreach($models as $model) |
57 | | - <tr class="{{ $this->trClass($model) }}"> |
| 25 | + <div class="table-responsive"> |
| 26 | + <table class="table {{ $table_class }} mb-0"> |
| 27 | + <thead class="{{ $thead_class }}"> |
| 28 | + <tr> |
58 | 29 | @if($checkbox && $checkbox_side == 'left') |
59 | | - @include('laravel-livewire-tables::checkbox-row') |
| 30 | + @include('laravel-livewire-tables::checkbox-all') |
60 | 31 | @endif |
61 | 32 |
|
62 | 33 | @foreach($columns as $column) |
63 | | - <td class="align-middle {{ $this->tdClass($column->attribute, $value = Arr::get($model->toArray(), $column->attribute)) }}"> |
64 | | - @if($column->view) |
65 | | - @include($column->view) |
| 34 | + <th class="align-middle text-nowrap border-top-0 {{ $this->thClass($column->attribute) }}"> |
| 35 | + @if($column->sortable) |
| 36 | + <span style="cursor: pointer;" wire:click="sort('{{ $column->attribute }}')"> |
| 37 | + {{ $column->heading }} |
| 38 | + |
| 39 | + @if($sort_attribute == $column->attribute) |
| 40 | + <i class="fa fa-sort-amount-{{ $sort_direction == 'asc' ? 'up-alt' : 'down' }}"></i> |
| 41 | + @else |
| 42 | + <i class="fa fa-sort-amount-up-alt" style="opacity: .35;"></i> |
| 43 | + @endif |
| 44 | + </span> |
66 | 45 | @else |
67 | | - {{ $value }} |
| 46 | + {{ $column->heading }} |
68 | 47 | @endif |
69 | | - </td> |
| 48 | + </th> |
70 | 49 | @endforeach |
71 | 50 |
|
72 | 51 | @if($checkbox && $checkbox_side == 'right') |
73 | | - @include('laravel-livewire-tables::checkbox-row') |
| 52 | + @include('laravel-livewire-tables::checkbox-all') |
74 | 53 | @endif |
75 | 54 | </tr> |
76 | | - @endforeach |
77 | | - </tbody> |
78 | | - </table> |
| 55 | + </thead> |
| 56 | + <tbody> |
| 57 | + @foreach($models as $model) |
| 58 | + <tr class="{{ $this->trClass($model) }}"> |
| 59 | + @if($checkbox && $checkbox_side == 'left') |
| 60 | + @include('laravel-livewire-tables::checkbox-row') |
| 61 | + @endif |
| 62 | + |
| 63 | + @foreach($columns as $column) |
| 64 | + <td class="align-middle {{ $this->tdClass($column->attribute, $value = Arr::get($model->toArray(), $column->attribute)) }}"> |
| 65 | + @if($column->view) |
| 66 | + @include($column->view) |
| 67 | + @else |
| 68 | + {{ $value }} |
| 69 | + @endif |
| 70 | + </td> |
| 71 | + @endforeach |
| 72 | + |
| 73 | + @if($checkbox && $checkbox_side == 'right') |
| 74 | + @include('laravel-livewire-tables::checkbox-row') |
| 75 | + @endif |
| 76 | + </tr> |
| 77 | + @endforeach |
| 78 | + </tbody> |
| 79 | + </table> |
| 80 | + </div> |
79 | 81 | </div> |
80 | 82 | @endif |
81 | 83 | </div> |
|
0 commit comments