-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabled by default but can be disabled explicitly. Address support for wasm-wasi and unsafe concerns. Signed-off-by: roee88 <[email protected]>
- Loading branch information
Showing
9 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use comfy_table::presets::UTF8_FULL; | ||
use comfy_table::*; | ||
|
||
// This example works even with the `tty` feature disabled | ||
// You can try it out with `cargo run --example no_tty --no-default-features` | ||
|
||
fn main() { | ||
let mut table = Table::new(); | ||
table.load_preset(UTF8_FULL) | ||
.set_content_arrangement(ContentArrangement::Dynamic) | ||
.set_table_width(80) | ||
.set_header(vec![ | ||
Cell::new("Header1"), | ||
Cell::new("Header2"), | ||
Cell::new("Header3"), | ||
]) | ||
.add_row(vec![ | ||
Cell::new("No bold text without tty"), | ||
Cell::new("No colored text without tty"), | ||
Cell::new("No custom background without tty"), | ||
]) | ||
.add_row(vec![ | ||
Cell::new("Blinky boi"), | ||
Cell::new("This table's content is dynamically arranged. The table is exactly 80 characters wide.\nHere comes a reallylongwordthatshoulddynamicallywrap"), | ||
Cell::new("Done"), | ||
]); | ||
|
||
println!("{}", table); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters