<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>Account Name</th>
                <th class="text-end thbutton">Income</th>
                <th class="text-end thbutton">Expense</th>
            </tr>
        </thead>
        <tbody>
            @php $i=0;@endphp
            @if(count($profitAndLoss)>0)
                @foreach($profitAndLoss as $key => $list)
                    <tr>
                        <td class="text-center">{{  $accounts->firstItem() + $i }}</td>
                        <td>{{ $list['account_name']??'' }}</td>
                        <td class="text-end">{{ convertDecimelPoint($list['income'])??'' }}</td>
                        <td class="text-end">{{ convertDecimelPoint($list['expenses'])??'' }}</td>
                    </tr>
                    @php $i++; @endphp
                @endforeach
            @else
                <tr>
                    <td colspan="5">No Data Found</td>
                </tr>
            @endif
        </tbody>
    </table>
</div>
<nav class="row mt-2">
    <div class="col-lg-10 col-md-10 col-10 float-start">
        {!! $accounts->onEachSide(0)->render('financial-reports.profit-and-loss.pagination') !!}
    </div>
    <div class="col-lg-2 col-md-2 col-2 dataTables_length" id="example_length" style="text-align: right;">
            <i class="bi bi-funnel" style="top: 11px;left: 20px;"></i>
            <select class="form-select sorting sorting-box" id="" name="example_length" aria-controls="example" style="padding-left: 30px;">
                <option value="10" {!! $sort_by==10?'selected':'' !!}>Show: 10</option>
                <option value="30" {!! $sort_by==30?'selected':'' !!}>Show: 30</option>
                <option value="50" {!! $sort_by==50?'selected':'' !!}>Show: 50</option>
            </select>
    </div>
</nav>
</div>

