Re: Question: Structures_DataGrid and Empty Table

From: Date: Tue, 21 Oct 2008 19:51:41 +0000
Subject: Re: Question: Structures_DataGrid and Empty Table
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-29336@lists.php.net to get a copy of this message
Michael Mussulis wrote: > Is it possible to output a Structures_DataGrid table with just the column > headers and maybe one row spanning all columns with a message like "There > are no records", when a table is empty? It's easier to print a "There are no records" message without any table, with something like: if ($datagrid->getRecordCount() > 0) $datagrid->render(); else echo "<p>There are no records</p>"; However, if you really want to print this message within a spanning row, then you can manipulate the HTML_Table container before rendering: $table = new HTML_Table(); $datagrid->fill($table) if ($datagrid->getRecordCount() == 0) { $table->addRow(...); etc... } $table->display(); -- Olivier Guilyardi / Samalyse

« previous php.pear.general (#29336) next »