Commit 5971f1e6 authored by Dries's avatar Dries

- Patch #28777 by Neil: use <thead> and <tbody> in theme_table().

parent da74bce9
......@@ -697,8 +697,7 @@ function theme_submenu($links) {
* @return
* An HTML string representing the table.
*/
function theme_table($header, $rows, $attributes = NULL, $caption = NULL) {
function theme_table($header, $rows, $attributes = array(), $caption = NULL) {
$output = '<table'. drupal_attributes($attributes) .">\n";
if (isset($caption)) {
......@@ -708,15 +707,16 @@ function theme_table($header, $rows, $attributes = NULL, $caption = NULL) {
// Format the table header:
if (count($header)) {
$ts = tablesort_init($header);
$output .= ' <tr>';
$output .= ' <thead><tr>';
foreach ($header as $cell) {
$cell = tablesort_header($cell, $header, $ts);
$output .= _theme_table_cell($cell, 1);
}
$output .= " </tr>\n";
$output .= " </tr></thead>\n";
}
// Format the table rows:
$output .= "<tbody>\n";
if (count($rows)) {
foreach ($rows as $number => $row) {
$attributes = array();
......@@ -756,7 +756,7 @@ function theme_table($header, $rows, $attributes = NULL, $caption = NULL) {
}
}
$output .= "</table>\n";
$output .= "</tbody></table>\n";
return $output;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment