Skip to content

Commit

Permalink
fix: tabled
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterPtato committed Sep 9, 2024
1 parent de6645e commit d539a07
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ pub fn table<T>(iter: impl IntoIterator<Item = T>)
where
T: Tabled,
{
let mut table = Table::new(iter).with(tabled::Style::rounded());
let mut table = Table::new(iter);
table.with(tabled::settings::Style::rounded());

if let Some((w, _)) = term_size::dimensions() {
table = table.with(tabled::Width::wrap(w));
table.with(tabled::settings::Width::wrap(w));
}

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

Expand Down

0 comments on commit d539a07

Please sign in to comment.