Is there a way to center align the header and body of a table when printing it? I am using datatable.
Here is how it currently looks:
I have tried adding classes to the th tags in the HTML table, but they still appear aligned to the left when printed.
This is what I attempted:
I included a class in the table:
"columnDefs":[
{
"targets":[0,1,2,3],
"orderable":false,
className: "dt-head-center"
},
Then, I styled the class like this:
.dt-head-center {
text-align: center;
}
Unfortunately, this approach did not work. Can someone please help me fix this issue?