up vote 0 down vote favorite
share [fb]

I dislike the notion of using something like this since it may mean I have to commit my table data straight to HTML sooner than I want to:

$render_array = array(
    'maintable' => array(
        '#markup' = theme_table($table)
    ),
    ...
);

Do I have an option to pass the table data into the render array (as opposed to rendering it immediately to HTML), by chance?

link|improve this question

75% accept rate
Why do you dislike it? – Jukebox Oct 5 at 19:51
I just edited that part in. – Hamster Oct 5 at 19:53
feedback

1 Answer

up vote 2 down vote accepted
$render_array['maintable'] = array(
  '#theme' => 'table',
  '#header' => $header,
  '#rows' => $rows,
);
link|improve this answer
Oh, so that works? – Hamster Oct 5 at 20:30
of course :) examples: contact_category_list(), dblog_overview(), dblog_top(), etc – xandeadx Oct 5 at 21:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.