Skip to content

Commit

Permalink
tabled/ Add highlight example
Browse files Browse the repository at this point in the history
Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
  • Loading branch information
zhiburt committed Dec 30, 2021
1 parent cd2253e commit 1a167a9
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/highlight.rs
@@ -0,0 +1,16 @@
//! The example can be run by this command
//! `cargo run --example highlight`

use tabled::{Border, Highlight, Style, TableIteratorExt};

fn main() {
let data = vec![["A", "B", "C"], ["D", "E", "F"], ["G", "H", "I"]];

let table = data.table().with(Style::PSEUDO).with(Highlight::cell(
2,
1,
Border::full('*', '*', '*', '*', '*', '*', '*', '*'),
));

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

0 comments on commit 1a167a9

Please sign in to comment.