Header data for column width calculation

Header data for column width calculation

gborekgborek Posts: 4Questions: 2Answers: 0

How can I include header data to properly calculate column width? Currently if the row data is "shorter" than column header the sort indicator is "below" or overlaps with the text. It's get even worse if I use custom style with font-awsome indicators based on ":after" css. The headers are misaligned with the columns. I have tried to update the calculation formula but it was too complex..
Any suggestions how to do this ?

Answers

  • RpiechuraRpiechura Posts: 98Questions: 3Answers: 14

    The simplest way for someone to know how to help you (as I don't exactly know what you mean) would be to provide the nessicary information to show what the problem is. For this, since it sounds like you're having a fairly specific alignment issue than i'd do two things. First I'd take a screen shot of the table as you see it so that we can easily see what you mean when you say that the alignment is off.

    The second, and more important part would be to use the http://debug.datatables.net/ to give a link to the table information to see if there is something simple that you may have wrong with your initialization code / things you've already tried to fix the issue. It gives others (and perhaps more importantly yourself) the chance to see the initialization code that you've used.

  • RpiechuraRpiechura Posts: 98Questions: 3Answers: 14

    I think I understand the question, however the best answer I can give is that you shouldn't need to do a 'by-hand' calculation like that if things are being set up correctly. The easiest way to see if there is something wrong with your code is to use the debugger that I linked above.

  • gborekgborek Posts: 4Questions: 2Answers: 0

    Please find the debug data: http://debug.datatables.net/ayezaf

    I'm quite confident that in 1.9.4 version headers are not included in the calculation.
    With regular css the sort indicator will get overlap with the column header, since I'm using the css :after with font awsome I'm getting additional line since the header is wrapped.

    If the headers are included in the calculation, can you provide the functin/relative line? I could simply add extra padding there.

This discussion has been closed.