Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.1

Bug #13629 column zero content won't display if other columns with multiline
Submitted: 2008-04-08 20:21 UTC
From: farell Assigned: yunosh
Status: Closed Package: Console_Table (version 1.1.0)
PHP Version: 5.2.5 OS:
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 37 - 27 = ?

 
 [2008-04-08 20:21 UTC] farell (Laurent Laville)
Description: ------------ While I implemented a new feature for PHP_CompatInfo and its CLI I found after searching on my own code that error came from Console_Table. When there is a row with at least one column that is multiline, all columns that with content "0" won't be display . See especially row 1 col 2 and row 4 col 2. Test script: --------------- <?php require_once 'Console/Table.php'; $data = array( array('col1', 0, "col3\nmultiline", 'col4'), array('r2col1', 'r2col2', "r2col3\nmultiline", 'r2col4'), array('r3col1', 'r3col2', "r3col3\nmultiline\r\nverymuch", 'r3col4'), array('r4col1', 0, "r4col3", 'r4col4'), array('r5col1', 'r5col2', "r5col3", 'r5col4'), ); $table = new Console_Table(); $table->setHeaders(array("h1\nmultiline", 'h2', "h3", 'h4')); $table->addData($data); echo $table->getTable(); ?> Expected result: ---------------- +-----------+--------+-----------+--------+ | h1 | h2 | h3 | h4 | | multiline | | | | +-----------+--------+-----------+--------+ | col1 | 0 | col3 | col4 | | | | multiline | | | r2col1 | r2col2 | r2col3 | r2col4 | | | | multiline | | | r3col1 | r3col2 | r3col3 | r3col4 | | | | multiline | | | | | verymuch | | | r4col1 | 0 | r4col3 | r4col4 | | r5col1 | r5col2 | r5col3 | r5col4 | +-----------+--------+-----------+--------+ Actual result: -------------- +-----------+--------+-----------+--------+ | h1 | h2 | h3 | h4 | | multiline | | | | +-----------+--------+-----------+--------+ | col1 | | col3 | col4 | | | | multiline | | | r2col1 | r2col2 | r2col3 | r2col4 | | | | multiline | | | r3col1 | r3col2 | r3col3 | r3col4 | | | | multiline | | | | | verymuch | | | r4col1 | 0 | r4col3 | r4col4 | | r5col1 | r5col2 | r5col3 | r5col4 | +-----------+--------+-----------+--------+

Comments

 [2008-04-09 09:58 UTC] yunosh (Jan Schneider)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Console_Table