Skip to content

Commit

Permalink
Try to reproduce a formatting bug reported in comfy-table
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukesor committed Sep 26, 2022
1 parent f82f297 commit 9e33cda
Show file tree
Hide file tree
Showing 3 changed files with 350 additions and 0 deletions.
319 changes: 319 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "debug"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
comfy-table = "^6"
22 changes: 22 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use comfy_table::presets::*;
use comfy_table::*;

fn main() {
let header = vec!["a\n---\ni64", "b\n---\ni64", "b_squared\n---\ni64"];
let rows = vec![
vec!["1", "2", "4.0"],
vec!["3", "4", "16.0"],
vec!["5", "6", "36.0"],
];

let mut table = Table::new();

let table = table
.load_preset(UTF8_FULL)
.set_content_arrangement(ContentArrangement::Dynamic)
.set_width(100);

table.set_header(header).add_rows(rows);

println!("{}", table);
}

0 comments on commit 9e33cda

Please sign in to comment.