[development] theme('table')

Moshe Weitzman weitzman at tejasa.com
Sun Apr 22 12:48:13 UTC 2007

Gordon Heydon wrote:
> Hi,
> adrian rossouw wrote:
>> On 21 Apr 2007, at 8:41 PM, Moshe Weitzman wrote:
>>> this sounds nice and consistent to me ... or we expand drupal_render 
>>> usage and expect folks to override #theme if they want to take over 
>>> themeing for a certain table. that seems like a more long term 
>>> project, with more a bit more uncertainty.
>> doesn't that work today though ?
>> just needing a documentation change.

i think it does. so whats needed is some general agreement that we should 
output tables not directly through theme('table') but rather with a 
construct like:

$page['forum_overview'] = array(
   '#type' => 'table',
   '#header' => $header,
   '#rows' => $rows
$output = drupal_render($page);

the big advantage is that modules can alter a table as suggested by Gordon 
and that themers can override a single table with #theme. the disadvantage 
is a small performance dip. we'll do some benchmarking to understand the amount.

note that i'm only talking about output of tables through drupal_render(), 
not whole page.

More information about the development mailing list