- assigned_to: nobody --> richardarcher
File : table.inc v1.4 (1.4 2002/04/28 08:12:54
richardarcher)
CVS Module : php_lib
Database layer used : db_oci8
the table class skips the display of the <td> for each
element of the array passed to the 'show_table_cells' if
those elements containing NULL values
This breaks the html table structure and prevents results
to be displayed in some browsers, and gives a wrong
column display on others.
ex :
structure for the queried table :
$fields = array (
'0' => 'somefield',
'1' => 'someotherfield',
'2' => 'hugo',
'3' => 'bla'
);
structure of the returned data
$data = array (
0 => array (
'somefield' =>'something',
'someotherfield' =>'something else',
'hugo' =>'', // <------- NULL
'bla' => '1231654645'
),
1 => array (
'somefield' =>'something different',
'someotherfield' =>'', // <-- NULL
'hugo' =>'gneh', // <------- NOT NULL
'bla' => '4654654645'
),
2 => array (
'somefield' =>'something',
'someotherfield' =>'something else',
'hugo' =>'hugo', // <------- NOT NULL
'bla' => '1231654645'
),
Workaround (certainly not a valid fix but it worked for
me):
comment lines 610 and 612 like this :
/*if (isset($data[$val])) {*/
$this->table_cell($row, $cell++, $val, $data[$val],
$class);
/*}*/
so even if data is NULL it will display an empty html cell.