Releases: Nukesor/comfy-table
Releases · Nukesor/comfy-table
v6.1.1
Fixed
- Fixed an issue where dynamic arrangement failed when setting the table to the exact width of the content #90.
- The header size is now properly respected in the final optimization step #90.
Previously, this wasn't the case and lead to weird formatting behavior when both of the following were true- Dynamic content adjustment was active.
- The table didn't fit into the the available space.
- The header of a row was longer than its content.
- Fix wrong LowerBoundary calculation. This was introduced in commit bee764d, when this logic was refactored. #90.
Table::column_iter
no longer requires a&mut self
, but only&self
.
v6.1.0
v6.0.0
Added
- Add
Table::style_text_only()
, which prevents non-delimiter whitespaces in cells to be styled. - Add the
Table::discover_columns
function and add info on when to use it toRow::add_cell
.
Breaking Changes
- Renaming of several functions to be Rust idiomatic:
Cell::get_content
->Cell::content
Column::get_padding_width
->Column::padding_width
Column::get_constraint
->Column::constraint
Table::get_header
->Table::header
Table::get_table_width
->Table::width
Table::set_table_width
->Table::set_width
Table::set_style
->Table::style
Table::get_column
->Table::column
Table::get_column_mut
->Table::column_mut
Table::get_row
->Table::row
Table::get_row_mut
->Table::row_mut
Column::get_max_width
andColumn::get_max_content_width
have been removed as we cannot guarantee that these numbers are always correct.
UseTable::column_max_content_widths
instead
Changed
Table::column_max_content_widths
now performs a full scan of the table's content when called.- Don't include
Table::is_tty
,Table::force_no_tty
andTable::should_style
iftty
feature isn't enabled.
v6.0.0-rc.1
(cargo-release) comfy-table version 6.0.0-rc.1
v5.0.0
v4.1.1
v4.1.0
[4.1.0] - 2021-08-09
Added
- Add
modifiers::UTF8_SOLID_INNER_BORDERS
, which makes the inner borders solid lines:│─
by ModProg for #39. - Add
presets::ASCII_BORDERS_ONLY_CONDENSED
, which isASCII_BORDERS_ONLY
but without spacing between rows #43.
Fixed
- Several preset examples weren't correct.
- Multi-character UTF8 symbols are now handled correctly in most situations.
Table-layout might still break for 1-character columns. - Mid-word splitting now takes multi-character utf8 characters into account.
Changed
- Rename
ASCII_HORIZONTAL_BORDERS_ONLY
toASCII_HORIZONTAL_ONLY
. Old imports will still work until v5.0. - Rename
UTF8_HORIZONTAL_BORDERS_ONLY
toUTF8_HORIZONTAL_ONLY
. Old imports will still work until v5.0.
v4.0.1
v4.0.0
[4.0.0] - 2021-07-03
Added
- Add
Table::lines
, which returns an iterator over all lines of the final table output by dmaahs2017 for #35. - Add
ColumnConstraints::Boundaries{lower: Width, upper: Width}
to specify both an upper and a lower boundary.
Fixed
- Fixed percentages sometimes weren't correctly calculated, due to not taking border columns into account.
- Return
None
forTable::get_table_width
, if getting the terminal size somehow failed. - Fixed a lot of possible, but highly unlikely number conversion overflow issues.
- Run space optimization under all circumstances.
- Percentage constraints with values of >100 will now be capped to 100.
- The MinConstraint would be ignored when:
- The content was larger than the min constraint
- There was less space available than specified in the constraint.
Changed
- The way ColumnConstraints are initialized has been changed.
There is now
enum ColumnConstraints {
...,
/// Enforce a absolute width for a column.
Absolute(Width),
/// Specify a lower boundary, either fixed or as percentage of the total width.
LowerBoundary(Width),
/// Specify a upper boundary, either fixed or as percentage of the total width.
UpperBoundary(Width),
}
pub enum Width {
/// Specify a min amount of characters per line for a column.
Fixed(u16),
/// Set a a minimum percentage in respect to table_width for this column.
/// Values above 100 will be automatically reduced to 100.
/// **Warning:** This option will be ignored, if the width cannot be determined!
Percentage(u16),
}
Instead of the old
enum ColumnConstraints {
...,
Width(u16),
MinWidth(u16),
MaxWidth(u16),
Percentage(u16),
MinPercentage(u16),
MaxPercentage(u16),
}