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

Bug #8615 multiline cells not supported by headers
Submitted: 2006-09-02 08:28 UTC
From: farell Assigned: yunosh
Status: Closed Package: Console_Table (version 1.0.5)
PHP Version: 4.4.2 OS: windows xp
Roadmaps: (Not assigned)    
Subscription  


 [2006-09-02 08:28 UTC] farell (Laurent Laville)
Description: ------------ The patch introduces with version 1.0.4 which support multiline cells in row data, does not apply same behaviour on headers. Laurent Test script: --------------- <?php require_once 'Console/Table.php'; $data = array( array('col1', 'col2', "col3\nmultiline", 'col4'), array('r2col1', 'r2col2', "r2col3\nmultiline", 'r2col4'), array('r3col1', 'r3col2', "r3col3\nmultiline\r\nverymuch", 'r3col4'), array('r4col1', 'r4col2', "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 | col2 | col3 | col4 | | | | multiline | | | r2col1 | r2col2 | r2col3 | r2col4 | | | | multiline | | | r3col1 | r3col2 | r3col3 | r3col4 | | | | multiline | | | | | verymuch | | | r4col1 | r4col2 | r4col3 | r4col4 | | r5col1 | r5col2 | r5col3 | r5col4 | +--------------+--------+-----------+--------+ Actual result: -------------- +--------------+--------+-----------+--------+ | h1 multiline | h2 | h3 | h4 | +--------------+--------+-----------+--------+ | col1 | col2 | col3 | col4 | | | | multiline | | | r2col1 | r2col2 | r2col3 | r2col4 | | | | multiline | | | r3col1 | r3col2 | r3col3 | r3col4 | | | | multiline | | | | | verymuch | | | r4col1 | r4col2 | r4col3 | r4col4 | | r5col1 | r5col2 | r5col3 | r5col4 | +--------------+--------+-----------+--------+

Comments

 [2007-01-19 22:31 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