Column Header Alignment

Tags: #<Tag:0x00007fbe9354edc8>

How can we get the column header alignment to be Left or Right (not the standard Center only) ?

Topic was posted 3 years ago, but the JS Fiddle is no longer working:

It was also raised on the Github page, and those JS FIddle’s aren’t working either.

Any solutions again please?


Hey @indirextest2
Would that help ?

Thanks Aleksandra - exactly right.
How can I apply it to certain columns only ? Say Column A and C only

the 1st parameter of the afterGetColHeader hook is column_index so you can use the and IF statement for a certain column

afterGetColHeader: function(col, TH) {
     if(col == 2){
     	TH.className = 'htRight'

you do not need to use ‘ELSE’ in this case as other columns will get the default, centered alignment.

Perfect, thank you - solved :slight_smile:

Great. Thank you for the update.
We can close the topic.