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?
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";
...
Comments
Comment #1
derjochenmeyer commentedunfortunately i cant reproduce this... sticky headers are working for me :)
Comment #2
optalgin commentedSticky 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?
Comment #3
optalgin commentedAh...
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
* code taken from theme_table function,
see here: http://api.drupal.org/api/function/theme_table/6
Comment #4
tobiass commented#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 ;-)
Comment #5
derjochenmeyer commented