prettytable-rs icon indicating copy to clipboard operation
prettytable-rs copied to clipboard

table-in-table style loss

Open MoSal opened this issue 8 years ago • 1 comments

#[macro_use] extern crate prettytable;

use prettytable::Table;

fn main() {
    let in_table = table!([
                          Frbc->"Red",
                          Fgbc->"Green",
                          Fbbc->"Blue"
    ]);

    let mut table = Table::new();
    table.add_row(row![Frbc=> "Red", "Red", "Red", "Red"]);
    table.add_row(row![in_table]);

    in_table.printstd();
    table.printstd();
}

When in_table is added as a row in table. It loses its styles.

On a related note. An option to automatically inherit the format of the outer table would be great.

MoSal avatar Jan 23 '17 15:01 MoSal

In that case, in_table is converted into a string when inserted into table. Consequently, in_table looses all style attributes previoulsy added to it.

phsym avatar Jan 24 '17 21:01 phsym