1

I'm using a field collection on my node form and sticky table headers comes baked in with no way to disable it (that I can find, anyway). How do I disable sticky table headers? Preferably with Javascript or CSS... sadly, I'm using an instance of Drupal 7 that has a lot of the internals hidden from me.

2 Answers 2

2

One line of CSS will do it:

table.sticky-header { display: none !important; }

Answer found here.

1

Just chiming in here since I came across this page while searching for a solution and wanted to demonstrate the alternative to a CSS override.

If you want to remove this at the theme level — where arguably it should be — you'll want to look at theme_field_multiple_value_form.

That function calls theme('table'... w/out sending the 'sticky' => FALSE value) see theme_table.

If you override that function and set 'sticky' => FALSE, then the code that initialized the sticky header will be ignored.

If you want to only override this for a certain field, just reference the $variables['element']['#field_name'] value.

1
  • Agree that it should be removed at the theme layer and not in css. The problem is that 'theme_field_multiple_value_form' creates blobs of HTML and doesn't return a render array, so developers are left forking the entire function to get in there. At this stage I'm looking at the lesser of two evils.
    – Sam Becker
    Commented Jun 17, 2015 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.