-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Description
#[macro_use] extern crate prettytable;
extern crate ansi_term;
use prettytable::Table;
use ansi_term::Colour::Yellow;
fn main() {
// Okay
let mut table = Table::new();
table.add_row(row![ Fybl->"AAAAAAA", Fmbl->"BBB", Fgbl->"CCC"]);
table.add_row(row![ Fybl->"AAAAAAA", Fmbl->"BBB", Fgbl->"CCC"]);
table.add_row(row![ Fybl->"AAAAAAA", Fmbl->"BBB", Fgbl->"CCC"]);
table.add_row(row![ Fybl->"Yellow Yellow Yellow" ]);
table.printstd();
// Messed up
let mut table2 = Table::new();
table2.add_row(row![ Fybl->"AAAAAAA", Fmbl->"BBB", Fgbl->"CCC"]);
table2.add_row(row![ Fybl->"AAAAAAA", Fmbl->"BBB", Fgbl->"CCC"]);
table2.add_row(row![ Fybl->"AAAAAAA", Fmbl->"BBB", Fgbl->"CCC"]);
table2.add_row(row![ Yellow.bold().paint("Yellow Yellow Yellow") ]);
table2.printstd();
}In table2, the first column in the first 3 rows has extra paddings. Those paddings exist regardless of the alignment requested.
matthias-t
Metadata
Metadata
Assignees
Labels
No labels