Skip to content

output of a table to a string with styles -- is it possible? #141

@faried

Description

@faried

I have a Vec<String> that represents my output lines. I want to append a table to it but I can't seem to do that and preserve cell styles. I've tried

let mut output = Vec::<String>::new();

let mut table = Table::new();
table.add_row(row![Fg => "first", "second"]);

output.push(table.to_string());
// also tried
output.push(format!("{}", table));

I'm new to Rust, so I don't know if there's a way to do this (prettytable-rs 0.8.0).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions