Skip to content

Error in multiline cells #14

@spirali

Description

@spirali

Hello,

I get the following error when I use the multiline cell:

+---+-----+
| a | b   |
+---+-----+
thread 'main' panicked at 'Available dimensions for a cell are smaller than required. Please create an issue in https://github.com/devashishdxt/cli-table', /home/spirali/.cargo/git/checkouts/cli-table-957cc8afb9d2904a/73da33b/cli-table/src/cell.rs:124:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Code:

use cli_table::{Cell, print_stdout, Table, Style, Color};

fn main() {

    let mut rows = vec![
        vec!["a".cell(), "b".cell()],
        vec!["c".cell(), "xxx\nxxx\n".cell()]
    ];

    let table = rows.table();
    assert!(print_stdout(table).is_ok());
}

Tested on the current master (73da33b)

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