@foreach($row['sub_rows'] as $rowGroup) @php $rowGroup= $rowGroup['0']; $columnCount = count($rowGroup['columns']); // Number of columns in this row group $widthIndex = 0; $group = $rowGroup; @endphp @for($i = 0; $i < $columnCount; $i++) @php $inputs = $group['columns'][$i]['inputs'] ?? []; // Get the grouped inputs for this column $currentWidth = $group['columns'][$i]['width'] ?? 100; // Use normalized width or default to 100 $widthIndex++; @endphp @if(!empty($inputs)) <{{$group['type_row']}} style="width: {{ $currentWidth }}%" class="input-group sub-tabel-style" > @foreach($inputs as $input) @if(!isset($input['input_type'])) @continue; @endif @if($group['type_row'] == 'th' && count($group['columns']) == 1 && $input['input_type'] == 'label')
{{ $input['label'] ?? '' }}
@elseif($group['type_row'] === 'th')
{{ $input['label'] ?? '' }}
@elseif($input['input_type'] === 'label')
{{ $input['label'] ?? 'No label' }}
@elseif($input['input_type'] === 'radio' || $input['input_type'] === 'checkbox') @if( $group['single_multi_input'] !== 'single_input')
{{ $input['label'] ?? '' }}
@elseif(count(explode(",",$input['answer'])) > 1 )
{{ $input['label'] ?? '' }}
@endif
@if($input['answer'] !== ' ' && count($input['options'])==1) @elseif($input['answer'] !== ' ' && count($input['options'])>1)
{{ $input['label'] ?? '' }}
@else {{$input['answer']}} @endif
@else
{{ $input['label'] ?? 'No label' }}
@if($input['input_type'] === 'text' || $input['input_type'] === 'date' || $input['input_type'] === 'number' || $input['input_type'] === 'textarea' || $input['input_type'] === 'file' || $input['input_type'] === 'time') {{ $input['answer'] ?? $input['placeholder'] ?? 'No answer selected' }} @endif
@endif @endforeach @else @endif @endfor
 
@endforeach