Created
September 13, 2011 23:32
-
-
Save johnrobertwilson/1215479 to your computer and use it in GitHub Desktop.
Easy Drupal 7 Tables output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$data = array(0 => 'data1', 1 => 'data2', 2 => 'data3'); | |
$data_table = array( | |
'#theme' => 'table', | |
'#header' => array(t('data index'), t('data value')), | |
'#empty' => t('You have no content channels for this account.'), | |
'#rows' => array(), | |
); | |
if(!empty($data)){ | |
foreach($data as $data_item_index => $data_item){ | |
$content_channels_table['#rows'][] = array($data_item_index, $data_item[$data_item_index]); | |
} | |
} | |
render($data_table); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment