You are here

function _theme_table_cell in Drupal 4

Same name and namespace in other branches
  1. 5 includes/theme.inc \_theme_table_cell()
  2. 6 includes/theme.inc \_theme_table_cell()
  3. 7 includes/theme.inc \_theme_table_cell()

End of "defgroup themeable".

Related topics

1 call to _theme_table_cell()
theme_table in includes/theme.inc
Return a themed table.

File

includes/theme.inc, line 1010
The theme system, which controls the output of Drupal.

Code

function _theme_table_cell($cell, $header = 0) {
  $attributes = '';
  if (is_array($cell)) {
    $data = $cell['data'];
    foreach ($cell as $key => $value) {
      if ($key != 'data') {
        $attributes .= " {$key}=\"{$value}\"";
      }
    }
  }
  else {
    $data = $cell;
  }
  if ($header) {
    $output = "<th{$attributes}>{$data}</th>";
  }
  else {
    $output = "<td{$attributes}>{$data}</td>";
  }
  return $output;
}