diff --git a/core/includes/theme.inc b/core/includes/theme.inc index cc60af2..e3bc350 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2013,6 +2013,12 @@ function drupal_pre_render_table(array $element) { * narrow viewports to save horizontal space. * - 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 @@ -2076,6 +2082,7 @@ function drupal_pre_render_table(array $element) { */ function theme_table($variables) { $header = $variables['header']; + $footer = $variables['footer']; $rows = $variables['rows']; $attributes = $variables['attributes']; $caption = $variables['caption']; @@ -2188,6 +2195,19 @@ function theme_table($variables) { $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) ? '