<table class="table table-hover nowrap dataTable dtr-inline collapsed tbFaltantes" id="tbFaltantes" width="100%" role="grid"
       aria-describedby="tbFaltantes_info">
    <thead class="thead-default">
    <tr>

        <th>Apellido Paterno</th>
        <th>Apellido Materno</th>
        <th>Nombre</th>
        <th>Cantidad de tardanzas</th>
    </tr>
    </thead>
    <tbody>
    @foreach($faltas as $item)
        <tr>
            <td> {{ $item->apellido_paterno }} </td>
            <td> {{ $item->apellido_materno }} </td>
            <td> {{ $item->nombres }} </td>
            <td> {{ $item->count }} </td>
        </tr>
    @endforeach
    </tbody>
</table>

<script>
    $('#tbFaltantes').DataTable({
        "lengthMenu": [[25, 20, 50, -1], [25, 20, 50, "Todas"]],
        bFilter: true,
        "bLengthChange": false,
        bInfo: true,
        responsive: true,
        "autoWidth": true,
        "language": {
            "lengthMenu": "Mostrar _MENU_ Entradas",
            "zeroRecords": "No se encontraron registros",
            "info": "Mostrando la página _PAGE_ de _PAGES_",
            "infoEmpty": "No hay registros disponibles",
            "infoFiltered": "(filtrado de _MAX_ registros totales)",
            "search": "Buscar: ",
            "paginate": {
                "first": "Primero",
                "last": "Último",
                "next": "Siguiente",
                "previous": "Anterior"
            },
        },
        "order": [],
        "aoColumns": [
            {"bSearchable": true},
            {"bSearchable": true},
            {"bSearchable": true},
            {"bSearchable": false},
        ],
        "columns": [
            {"orderable": true},
            {"orderable": true},
            {"orderable": true},
            {"orderable": false},
        ],
        dom: 'Bfrtip',
        buttons: [
            {
                extend: 'excel',
                exportOptions: {
                    columns: [ 0, 1, 2,3 ]
                },
                title: 'Reporte de personal con mas tardanzas'
            },{
                extend: 'pdf',
                exportOptions: {
                    columns: [ 0, 1, 2 ,3]
                },
                pageSize: 'LEGAL',
                customize: function(doc) {
                    //pageMargins [left, top, right, bottom]
                    doc.pageMargins = [ 120, 20, 20, 20 ];
                },
                title: 'Reporte de personal con mas tardanzas'
            }

        ]
    });

</script>
