For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > February 2008 > Datagrid









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Datagrid
Ian Warner

2008-02-10, 7:04 pm

Hi

$output = $this->dataGrid->getOutput('HTMLTable', $rendererOptions);

I am outputting this

but my query is how do I assign a class to the main table element to
style this?

Is it possible or shall I just wrap in a DIV?

Or do I have to use

// // Create a HTML_Table
// $table = new HTML_Table(array('class' => 'tbl'));

Seems overkill to do this as I already have a table I can style?

Ian
Mark Wiesemann

2008-02-10, 7:04 pm

Hi Ian,

Ian Warner wrote:
> $output = $this->dataGrid->getOutput('HTMLTable', $rendererOptions);
>
> I am outputting this
>
> but my query is how do I assign a class to the main table element to
> style this?
>
> Is it possible or shall I just wrap in a DIV?
>
> Or do I have to use
>
> // // Create a HTML_Table
> // $table = new HTML_Table(array('class' => 'tbl'));
>
> Seems overkill to do this as I already have a table I can style?


Yes, creating your own table object is the best solution here. You'll
then just pass this object to the fill() method of Structures_Datagrid,
e.g. like this:

$table = new HTML_Table(array('class' => 'tbl'));
$this->dataGrid->fill($table, $rendererOptions);
$output = $table->toHtml();

Regards,
Mark

--
http://www.markwiesemann.eu
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com