-
Notifications
You must be signed in to change notification settings - Fork 94
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Nowadays Hightlight works from top to bottom and left to right, but it would be helpful if we could reverse it.
See.
use tabled::{
builder::Builder,
settings::{object::{Columns, Object, Rows}, themes::BorderCorrection, Border, Highlight, Span, Style}, Table,
};
fn main() {
let mut builder: Builder = Builder::new();
builder.push_record(vec!["", "a", "b", "c"]);
builder.push_record(vec!["1", "", "", ""]);
builder.push_record(vec!["2", "", "x", ""]);
builder.push_record(vec!["3", "", "", ""]);
let mut table = builder.build();
table.with(Style::modern());
table.modify((2, 2), (Span::column(2), Span::row(2)));
table.with(BorderCorrection::span());
table.with(Highlight::new(Columns::new(2..).intersect(Rows::new(2..))).border(Border::inherit(Style::modern())));
println!("{table}");
}┌───┬───┬───┬───┐
│ │ a │ b │ c │
├───┼───┼───┼───┤
│ 1 │ │ │ │
├───┼───┌───────┐
│ 2 │ │ x │
├───┼───│ │
│ 3 │ │ │
└───┴───└───────┘
Reverse logic would do
┌───┬───┬───┬───┐
│ │ a │ b │ c │
├───┼───┼───┼───┤
│ 1 │ │ │ │
├───┼───┼───┴───┘
│ 2 │ │ x │
├───┼───┤ │
│ 3 │ │ │
└───┴───┘───────┘
ref: #544
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers