Reputation: 1323
I am working with an HTML
file. Since my data is mainly tabular data. I leveraged on the beautiful styling Datatables
offers. However, I would like to change the colour, border colour
and increase the select icon beside the show entries
and increase the text
. For your convenience Einträge anzeigen is show entry just basically the de version.
Here is how it looks like right now:
And here is my corresponding javascript file incase you need to make reference:
<script>
$(document).ready(function() {
$(".se-pre-con").fadeOut("slow");
$('table thead tr').clone(true).appendTo( 'table thead' );
$('thead tr:eq(1) th').each( function (i) {
if(i > 4){
$(this).hide()
}
})
$('table').DataTable( {
fixedHeader: true,
language: {
processing: "Bitte warten ..",
search: "Suchen",
lengthMenu: "_MENU_ Einträge anzeigen",
info: "_START_ bis _END_ von _TOTAL_ Einträgen",
infoEmpty: "Keine Daten vorhanden",
infoFiltered: "(gefiltert von _MAX_ Einträgen)",
infoPostFix: "",
loadingRecords: "Wird geladen ..",
zeroRecords: "Keine Einträge vorhanden",
paginate: {
first: "Erste",
previous: "Zurück",
next: "Nächste",
last: "Letzte"}
},
initComplete: function () {
this.api().columns().every( function () {
var column = this;
console.log(column.index())
var select = $('<select><option value=""></option></select>')
.appendTo( $(column.header()).empty() )
.on( 'change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
column
.search( val ? '^'+val+'$' : '', true, false )
.draw();
} );
column.data().unique().sort().each( function ( d, j ) {
select.append( '<option value="'+d+'">'+d+'</option>' )
} );
} );
}
} );
} );
</script>
Upvotes: 0
Views: 3666
Reputation: 34168
Add CSS to make the element container for the select
bigger
.dataTables_length, .dataTables_length select{ font-size: 2em;}
Upvotes: 3