NOTE: I dont know how to get the posting text below to maintain the fixed with text in the code blocks?
Often when I use this module I will be displaying numeric data in the columns and will want the last row to be a totals row.
This code
| Posted on 2005-08-12 18:32:09-07 by techgeek |
| Is there any way to have a footer line? |
|
NOTE: I dont know how to get the posting text below to maintain the fixed with text in the code blocks?
Often when I use this module I will be displaying numeric data in the columns and will want the last row to be a totals row. This code
$t = new Text::ASCIITable;
$t->setCols("one",'two','three','four');
push @$t, ( "1" ) x 4; # Replaces $t->addrow();
push @$t, ( "2" ) x 4; # Replaces $t->addrow();
print $t; # Replaces print $t->draw();
looks like this
.=----+-----+-------+-----=.
| one | two | three | four |
|=----+-----+-------+-----=|
| 1 | 1 | 1 | 1 |
| 2 | 2 | 2 | 2 |
'=----+-----+-------+-----='
but I want to be able to have a table kind of look like this
.=----+-----+-------+-----=.
| one | two | three | four |
|=----+-----+-------+-----=|
| 1 | 1 | 1 | 1 |
| 2 | 2 | 2 | 2 |
|=----+-----+-------+-----=|
| 3 | 3 | 3 | 3 |
'=----+-----+-------+------'
Any ideas on how to do this? I dont want the module to do the adding I just want to be able to have a extra rowLine added prior to my last row which will separate the rows above from the final (total) row. I do not see directly how to do this easily within the module other than trying to generate a 2nd table just to do the last total line but this seems like it would be hard to insure the column widths matched the table above. Some ideas or possible enhancements assuming the module cant do this already: - A way to draw a RowLine not between every row but selectively? Maybe as I am adding my rows prior to the last row I could run a new command that would essentially tell the module that I wanted to add a RowLine after the last defined row. - Maybe a SetBotCols construct which could be done after all rows have been added and the module would add essentially a footer row Of the two the first probably gives more flexibilty in that a selective added RowLine could be added when needed. Just some thoughts? Thanks, techgeek |
| Direct Responses: 906 | Write a response |