I need to configure the padding of my DataTable (Bootstrap) headers through JavaScript and CSS because the arrows are getting too close to the header titles and getting cluttered when the columns are scaled. I tried to use JS, but I could not ...
Does anyone know how to help me?
.align-right {
text-align: right;
/*max-width: 80px*/
}
.align-left {
text-align: left;
/*max-width: 80px*/
}
.align-center {
text-align: center;
/*max-width: 80px*/
}
table.center-header th {
text-align: center;
}
table.dataTable thead span.sort-icon {
display: inline-block;
padding-left: 23px;
width: 16px;
height: 16px;
}
<script type="text/javascript">
$('#bancoGridDataTable').DataTable({
"columnDefs": [
{ className: "align-right", "targets": [4] },
{ className: "align-center", "targets": [5] },
{ className: "align-right", "targets": [0] },
{ className: "table.dataTable thead span.sort-icon", "targets": [0] }
],
language: {
"sEmptyTable": "Nenhum registro encontrado",
"sInfo": "Mostrando de _START_ até _END_ de _TOTAL_ registros",
"sInfoEmpty": "Mostrando 0 até 0 de 0 registros",
"sInfoFiltered": "(Filtrados de _MAX_ registros)",
"sInfoPostFix": "",
"sInfoThousands": ".",
"sLengthMenu": "_MENU_ resultados por página",
"sLoadingRecords": "Carregando...",
"sProcessing": "Processando...",
"sZeroRecords": "Nenhum registro encontrado",
"sSearch": "Pesquisar",
"searchPlaceholder": "Pesquise qualquer coisa",
"oPaginate": {
"sNext": "Próximo",
"sPrevious": "Anterior",
"sFirst": "Primeiro",
"sLast": "Último"
},
"oAria": {
"sSortAscending": ": Ordenar colunas de forma ascendente",
"sSortDescending": ": Ordenar colunas de forma descendente"
}
}
});