Index: includes/common.inc =================================================================== --- includes/common.inc (revision 307) +++ includes/common.inc (working copy) @@ -6676,7 +6676,7 @@ 'variables' => array(), ), 'table' => array( - 'variables' => array('header' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'empty' => ''), + 'variables' => array('header' => NULL, 'footer' => NULL, 'rows' => NULL, 'attributes' => array(), 'caption' => NULL, 'colgroups' => array(), 'sticky' => TRUE, 'empty' => ''), ), 'tablesort_indicator' => array( 'variables' => array('style' => NULL), Index: includes/theme.inc =================================================================== --- includes/theme.inc (revision 307) +++ includes/theme.inc (working copy) @@ -1804,6 +1804,12 @@ * - "sort": A default sort order for this column ("asc" or "desc"). * - Any HTML attributes, such as "colspan", to apply to the column header * cell. + * - footer: An array containing the table footers. Each element of the array + * can be either a localized string or an associative array with the + * following keys: + * - "data": The localized title of the table column. + * - Any HTML attributes, such as "colspan", to apply to the column header + * cell. * - rows: An array of table rows. Every row is an array of cells, or an * associative array with the following keys: * - "data": an array of cells @@ -1867,6 +1873,7 @@ */ function theme_table($variables) { $header = $variables['header']; + $footer = $variables['footer']; $rows = $variables['rows']; $attributes = $variables['attributes']; $caption = $variables['caption']; @@ -1954,6 +1961,19 @@ $ts = array(); } + if (count($footer)) { + // HTML requires that the tfoot tag has tr tags in it followed by tbody + // tags. Using ternary operator to check and see if we have any rows. + $output .= (count($rows) ? ' ' : ' '); + $i = 0; + foreach ($footer as $cell) { + $cell = tablesort_cell($cell, $header, $ts, $i++); + $output .= _theme_table_cell($cell); + } + // Using ternary operator to close the tags based on whether or not there are rows + $output .= (count($rows) ? " \n" : "\n"); + } + // Format the table rows: if (count($rows)) { $output .= "\n";