there are several views set up with "table" style. Now I wish to use class "sticky-enabled" together with "misc/tableheader.js" to make the table header sticky. The view is defined as a default-view and I put the line

$handler->override_option('css_class', 'sticky-enabled');

in it's definition. I also put a line in the according template (using "content template") to ensure the js-file is inserted.
But the table doesn't get sticky. And when I look at the page source I see that the class "sticky-enabled" is not assigned to the table-tag itself, but to some div-tag a couple of steps higher. I think that this causes the problem.
So, my question is:
How can I achieve class "sticky-enabled" assigned to tag "table" ?

Comments

schildi’s picture

Meanwhile I found that there is a style option 'Enable Drupal style "sticky" table headers' when editing a default view with table style. I checked this but when embedding the view in the body of a node (using the [view:...] syntax) the resulting html code does NOT contain a sticky-enabled class. What is going wrong?

My fault! I forgot to save the view after changing the option.
Now the table has the class "sticky-enabled" assigned and the header is sticky. Not all attributes are correctly handled (eg. borders are missing) but that is another question.