But, when I have nestedHeaders I want to align them in center, my question is on afterGetColHeader how I distinct nestedHeaders to the rest of columns?
Unfortunately, the afterGetColHeader hook works for data underneath the nested header structure so when we (for example) want to change a header color to red for all headers with an index col < 3 we get the following result.
Our purpose is align column text based on column data type. example:
Numeric - right;
Text / Dates - left;
So, we are using afterGetColHeader hook to check column data type and align column header text.
But, like I said before we cannot distinct nestedHeaders to the rest of columns.
Can you put some html class on nestedHeaders to identify them? With this class I can verify if TH element has this class is nestedHeader so alignment is center.
I think that it could be a good idea. I was also thinking about adding row parameter to the afterGetColHeader, as currently, I cannot see any workaround for this issue.
It may be a good idea for us both, but under the hood Handsontable may be checking if some classes are present and doing something else after that. I remember I have been talking about a similar issue with one of our developers and he has told me that the headers processes are currently very complex.
I will discuss the issue with our devs but it won’t be added to our next release (next month) as the version has been already closed for development.
all this settings are pure CSS, if you would like to have all headers in font-size: 1.9em then you use .handsontable thead TR, if only the first one then .handsontable thead TR:nth-child(1) and if the second one .handsontable thead TR:nth-child(2).
I am really sorry but we have been talking about nestedHeaders and then you’ve wrote that
so I have to say that I am a little bit lost. However, here Handsontable example - JSFiddle - Code Playground I have placed a very similar example to what you have posted in the first comment and I hope it will come in handy.
I am really sorry I couldn’t help you with this request. I totally ignored the fact about ‘not having’ or ‘switching’ a non-nested header structure. I think that actually, classes may help here.
I have come up with another example, but I am not sure if it would meet your project requirements, here it is http://jsfiddle.net/Lpxbt3w5/
I have sent the idea to our internal ticketing system, however, for features - not bugs, we usually set lower priority. I will discuss the case with our developers if they could add the following code to a next release
Usually, but not always. I just do not want to give any promises as I am not the one who creates the milestones. However, I’ll do my best to push the idea as fast as I can.