Skip to content

Cell width incorrect when using external formatting #165

@Myzel394

Description

@Myzel394

This has already been discussed in #46 and it seemed as if this got resolved. However, it seems as if this is still an issue / reoccurred.

Here's an example when using the colored crate:

use colored::Colorize;
use prettytable::{format, row, Table};

fn main() {
        let mut table = Table::new();

        table.add_row(row![
            "Hello".yellow(),
        ]);

        table.printstd();
}

running this results in the following table:

+---------+
| Hello |
+---------+

you can see at the end the cell is one character too small

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