Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/tylerfra/public_html/includes/common.inc).

Drupal - Theme Table Example

Category: 

Drupal 7

$header = array();
$header[] = array("data" => "Column Header Title 1");
$header[] = array("data" => "Column Header Title 2");

$row = array();
$row[] = "Row Column 1 Data"; 
$row[] = "Row Column 2 Data";

$rows = array();
$rows[] = $row;
$html = theme('table', array('header' => $header, 'rows' => $rows));

Drupal 6

$header = array();
$header[] = array("data" => "Column Header Title 1");
$header[] = array("data" => "Column Header Title 2");

$row = array();
$row[] = "Row Column 1 Data"; 
$row[] = "Row Column 2 Data";

$rows = array();
$rows[] = $row;

$html = theme('table', $header, $rows);

Comments

Great tutorial!!!!!