6 if (file_exists(dirname(__FILE__) . '/../Table.php')) {
7 require_once dirname(__FILE__) . '/../Table.php';
9 require_once 'Console/Table.php';
13 array('col1', '0', "col3\nmultiline", 'col4'),
14 array('r2col1', 'r2col2', "r2col3\nmultiline", 'r2col4'),
15 array('r3col1', 'r3col2', "r3col3\nmultiline\r\nverymuch", 'r3col4'),
16 array('r4col1', 'r4col2', "r4col3", 'r4col4'),
17 array('r5col1', 'r5col2', "r5col3", 'r5col4'),
20 $table = new Console_Table();
21 $table->setHeaders(array("h1\nmultiline", 'h2', "h3", 'h4'));
22 $table->addData($data);
23 echo $table->getTable();
25 echo Console_Table::fromArray(array('one line header'),
26 array(array("multiple\nlines"),
31 +-----------+--------+-----------+--------+
34 +-----------+--------+-----------+--------+
35 | col1 | 0 | col3 | col4 |
37 | r2col1 | r2col2 | r2col3 | r2col4 |
39 | r3col1 | r3col2 | r3col3 | r3col4 |
42 | r4col1 | r4col2 | r4col3 | r4col4 |
43 | r5col1 | r5col2 | r5col3 | r5col4 |
44 +-----------+--------+-----------+--------+