<div class="table-responsive">
    <table id="example" class="table table-bordered align-middle" style="width:100%">
        <thead class="table-light">
            <tr>
                <th class="thbutton">Sl No</th>
                <th>Module Name</th>
                <th style="width: 10%;text-align: center;">Status</th>
                <th style="width: 10%;text-align: center;">Child Module</th>
            </tr>
        </thead>
        <tbody class="tablecontents">
            @php $i=1;@endphp
            @if(count($data)>0)
                @foreach($data as $key=> $list)
                    <tr style="cursor: move;" class="row1" data-id="{{ $list->id }}">
                        <td class="item_sno">{{$data->firstItem() + $key}}</td>
                        <td>{{ucfirst($list->menu_name)}}</td>
                        <td style="text-align: center;">
                            <div class="form-check form-check-inline{{ $i }}">
                                <input class="form-check-input{{ $i }} btn-lg changeStatusCustom" type="checkbox" id="inlineCheckbox{{ $i }}" data-url="{{ route('plan-module-mapping.changestatus') }}" data-id="{{ $id }}" data-module="{{ $list->code }}" data-status="{{ !in_array($list->code, $mapped_modules) ? '1' : '0' }}" {{ in_array($list->code, $mapped_modules) ? 'checked' : '' }}>
                            </div>
                        </td>
                        <td style="text-align: center;">
                            <a href="{{route('plan-child-module-mapping', ['id' => $id, 'parent_id' => $list->id])}}" class="btn btn-primary">
                                <i class="bi bi-search text-white"></i>
                            </a>
                        </td>
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
                <tr>
                    <td colspan="8">No Data Found</td>
                </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="float-start mt-2">
    <ul class="pagination">
        {!! $data->onEachSide(0)->render('product-feature-modules.pagination') !!}
    </ul>
</nav>
</div>

