<div class="table-responsive">
    <table id="list_data" class="table table-striped" style="width:100%">
        <thead>
            <tr>
                <th class="text-center">NO</th>
                <th class="text-left">TANGGAL</th>
                <th class="text-left">KETERANGAN</th>
                <?php
                    if(in_array($this->session->userdata('level_user'), array("1"))) {
                ?>
                <th class="text-center">AKSI</th>
                <?php
                    }
                ?>
            </tr>
        </thead>
        <tbody>
        </tbody>
    </table>
</div>
<script type="text/javascript">
    $(function() {
        list_data = $('#list_data').DataTable({ 
                    'searching'   : true,
                    'paging'      : true,
                    'lengthChange': true,
                    'ordering'    : true,
                    'info'        : true,
                    'scrollX'     : true,
                    // 'scrollCollapse': true,
                    // 'fixedColumns': true,
                    'language'    :{
                                    'url'         : '<?=base_url("assets/plugins/datatables/dataTables-language-id.json")?>',
                                    'sEmptyTable' : 'Tidak ada data untuk ditampilkan',
                                    'searchPlaceholder': 'Keterangan'
                                },
                    "processing"  : true, 
                    "serverSide"  : true, 
                    "order"       : [], 
                    
                    "ajax"        : {
                                    "url": "<?= site_url('pengaturan/hari-libur/list_data') ?>/<?= $tahun ?>",
                                    "type": "POST",
                                        "complete" : function(data){
                                            reconfigure(data);
                                        }
                                    },
            
                    "aoColumnDefs": [
                                        { "aTargets": [0], "bSortable": false }
                                        <?php
                                            if (in_array($this->session->userdata('level_user'), array("1"))) {
                                        ?>
                                        , { "aTargets": [3], "bSortable": false }

                                        <?php }?>
                                    ],
                    "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
                            $('td:eq(0)', nRow).css({'text-align':'center'});
                            $('td:eq(0)', nRow).css({'width':'10px'});
                            
                            <?php
                                if (in_array($this->session->userdata('level_user'), array("1"))) {
                            ?>

                            $('td:eq(3)', nRow).css({'text-align':'center'});
                            $('td:eq(3)', nRow).css({'width':'100px'});

                            <?php }?>
                    }
        
        });

    });
</script>