This time I have a simple question.
Here there is my query results, showed in the web app using jQuery Data Table:
As you can see, the elements are not centered inside the column cells. So, the question is: how can I show the elements, both numbers and buttons, centered?
This time I have a simple question.
Here there is my query results, showed in the web app using jQuery Data Table:
As you can see, the elements are not centered inside the column cells. So, the question is: how can I show the elements, both numbers and buttons, centered?
Share Improve this question asked Aug 9, 2017 at 9:38 Luca SepeLuca Sepe 8155 gold badges20 silver badges32 bronze badges 2- Can you post the html and css? – Thomas Orlita Commented Aug 9, 2017 at 9:39
- text-align: center; Works also for your buttons. – Doomenik Commented Aug 9, 2017 at 9:41
1 Answer
Reset to default 6Add
th.dt-center, td.dt-center { text-align: center; }
to your css, or use Javascript
$(document).ready( function () {
var table = $('#example').DataTable({
"columnDefs": [
{"className": "dt-center", "targets": "_all"}
]
});
});