Skip to content

Commit 5da291e

Browse files
authored
Render only one td with column value if label is empty
1 parent 4fca689 commit 5da291e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/resources/views/crud/inc/show_table.blade.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
<tbody>
44
@foreach($columns as $column)
55
<tr>
6-
<td @if($loop->index === 0) class="border-top-0" @endif>
7-
<strong>{!! $column['label'] !!}:</strong>
8-
</td>
9-
<td @if($loop->index === 0) class="border-top-0" @endif>
6+
@if(!empty($column['label']))
7+
<td @if($loop->index === 0) class="border-top-0" @endif>
8+
<strong>{!! $column['label'] !!}:</strong>
9+
</td>
10+
@endif
11+
<td colspan="{{ !empty($column['label']) ? 1 : 2 }}" @if($loop->index === 0) class="border-top-0" @endif>
1012
@php
1113
// create a list of paths to column blade views
1214
// including the configured view_namespaces
@@ -36,4 +38,4 @@
3638
@endif
3739
</tbody>
3840
</table>
39-
@endif
41+
@endif

0 commit comments

Comments
 (0)