[development] some secret to using theme('table'...) ?

nan wich nan_wich at bellsouth.net
Fri Oct 29 04:07:19 UTC 2010


I have never been able to control a table in HTML. It always has to be in 
the CSS.
 
Nancy
 
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.




________________________________
From: Blake Senftner <bsenftner at earthlink.net>
To: development at drupal.org
Sent: Thu, October 28, 2010 9:14:04 PM
Subject: [development] some secret to using theme('table'...) ?

Hmmm... I have the following logic in a module's hook_view() creating a table 
out of programmatically generated information: 


  $header =  array(t($node->title), t('Values:'));
  $rows = array(array('<strong>Project status:</strong>', $statusMarkup), 
                array('<strong>Notes:</strong>',         
 $node->content['body']['#value']),
                array('<strong>Images:</strong>',         $imagesMarkup),
                array('<strong>Image Tags:</strong>',     $imageTagMarkup),
                array('<strong>Reconstructions:</strong>',$reconsMarkup),
                array('<strong>Actions:</strong>',        $actionsMarkup));
  $table = theme('table', $header, $rows, array('style' => 'width: 770px', 
'class' => 'form-item'));
  $node->content['body']['#value'] = $table;

Notice that portion where I declare the width of the table to only be 770px? 
That is being ignored... I've tried variations like:

array( 'width' => '770px', ...) [note not 'style' here] and array( 'style' => 
'width: 77px;', ...) [note added semicolon here]

When I don't use the 'style' attribute, the sticky-header gets a style setting 
with the width set to '877.617px;', so it looks like the 'style' usage is what I 
need, but I'm not finding the magic combination...

any advice? 

Sincerely,
-Blake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20101028/ad428669/attachment.html 


More information about the development mailing list