This is a really great feature in D6 and I would love to see it in this theme.

Thanks for such a wonderful theme.

Comments

derjochenmeyer’s picture

unfortunately i cant reproduce this... sticky headers are working for me :)

Optalgin’s picture

Title: There are no sticky table headers. » A sticky question :-)

Sticky table headers works fine for me on FF2&IE7
I can see it in some pages (like block configuration)

When I use the function -- theme('table',...) to create my own table, the headers are not sticky..
What exactly do I have to do to enable 'sticky headers' for my custom table?

Optalgin’s picture

Title: A sticky question :-) » There are no sticky table headers.

Ah...

I found that there is no sticky support in the phptemplate_table override in template.php
Add this code (marked with +) and all table will automatically support sticky headers


function phptemplate_table($header, $rows, $attributes = array(), $caption = NULL) {
    
+   if (count($header)) {
+    drupal_add_js('misc/tableheader.js');
+    // Add 'sticky-enabled' class to the table to identify it for JS.
+    // This is needed to target tables constructed by this function.
+    $attributes['class'] = empty($attributes['class']) ? 'sticky-enabled' : ($attributes['class'] .' sticky-enabled');
+  }

  $output = '<div class="tablewrapper">';
  $output .= '<table'. drupal_attributes($attributes) ." class=\"tableclass\">\n";

  ...

* code taken from theme_table function,
see here: http://api.drupal.org/api/function/theme_table/6

tobiass’s picture

Version: 6.x-1.8 » 6.x-1.20

#3 worked great to add sticky table headers to the four seasons theme.

I think this is worth to include it in the next release if there will be one ;-)

derjochenmeyer’s picture

Status: Active » Reviewed & tested by the community