<table id="example" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
    <thead>
        <tr>
            <th>Code</th>
            <th>Item Name</th>
            <th>Qty</th>
            <th>Rate</th>
            <th>CrDr</th>
        </tr>
    </thead>
    <tbody>

        @foreach($data as $result)

        <tr>
            <td>{{$result->Code}}</td>
            <td>{{$result->Name}}</td>
            <td>{{$result->Qty}}</td>
            <td>&#8377;{{number_format($result->Rate,2)}}</td>
            @if($result->AddMinus == '-')
            <td><span style='color:green;'>Credit</span></td>
            @else
            <td><span style='color:red;'>Debit</span></td>
            @endif

        </tr>

        @endforeach
    </tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $('#example').DataTable({
        responsive: true
    });
});
</script>