DataTables / FixedHeader

Fix the header, footer, left or right columns of a table in place, to always show them when scrolling
http://www.datatables.net/
Other
75 stars 83 forks source link

Add class to fixed footer #90

Closed althaus closed 7 years ago

althaus commented 7 years ago

At the moment a cloned footer has the same classes as a cloned header. It'd be great, if you'd add something like dt-fixedFooter or fixedFooter-floating to the clone. Otherwise you have to dig into the element to see if it contains a thead or tfoot.

Cheers Matthias

DataTables commented 7 years ago

I was going to say you could just a little bit more to your selector, but you've already noted that. What's the issue with doing that?

althaus commented 7 years ago

On the one hand it's kinda strange that the footer has a class header ;-). I can control my stuff through something like table.fixedHeader-floating > tfoot .my-stuff.

On the other hand its not possible to style the footer through CSS directly. I'd need $('table.fixedHeader-floating > tfoot').parent().css('color', 'green'); if I don't miss anything.

DataTables commented 7 years ago

Yes, I guess the fact that header is in the name isn't too helpful here!

You probably don't need to use parent() in the second line of code, but that would work okay.

althaus commented 7 years ago

You probably don't need to use parent() in the second line of code, but that would work okay.

Due to the fact that tfoot fills ups the whole table? Yea... you could be right. That was just an example. ;-)

Feel free to close the issue, if you think the proposed ways are good enough for real world usage.

DataTables commented 7 years ago

I think its a perfectly valid point, but to my mind you are just moving the point of selection from a tag to a class name.

I don't disagree with this on principle, which the inverse, being able to select easily is important. But I'm not convinced by the need to add another class for this case. Having said that, if others also feel it would be useful I would be happy to include it.