comfy-table
An easy to use library for building beautiful tables with automatic content wrapping
8.0.0
93M downloads/mo
#844 most downloaded on crates.io
nukesor/comfy-table
What this package is like to depend on
Last release 18 days ago
05 Aug 2026
Ships fairly regularly
a new release about every 4 months
Most releases are documented
notes for 41 of 46 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
47 releases · first in 2020
3 releases in the last 12 months
see the full history below
Release timeline
47 releases · Jan 2020 to Aug 2026Releases
latest 47-
8.0.005 Aug 2026Release notes
Open source →[8.0.0] - 05.08.2026
Breaking Changes
-
The following types and functions have been removed:
TableComponentenum- The
modifiersmodule andTable::apply_modifierhave been removed. Table::current_style_as_presetTable::set_styleTable::styleTable::remove_styleTable::load_preset
-
The positional preset string format has been replaced with the new
TableStyle,LineStyleandContentLineStyletypes.
The old approach of having "stringified" presets was too finicky and also implicitly bound to the order of variants in the oldTableComponentenum.
It was just not a good design.The new design, in comparison, has a nice and (hopefully) intuitive API to define a style.
On top of that, all functions onTableStyleareconst, so custom styles can still be declared as constants:const MY_STYLE: TableStyle = TableStyle::new() .top_border(LineStyle::new('┌', '─', '┬', '┐')) .header_lines(ContentLineStyle::new('│', '┆', '│')) .header_separator(LineStyle::new('╞', '═', '╪', '╡')) .content_lines(ContentLineStyle::new('│', '┆', '│')) .bottom_border(LineStyle::new('└', '─', '┴', '┘'));
The new API looks as follows:
- Presets in
comfy_table::presets::*are nowTableStyleconstants. Table::load_style(style)has been added to load a preset or custom style.Table::style()andTable::style_mut()to get a handle to the style used by the table.
Themuthandle can be used to change the style.- Instead of modifiers, there are now functions on TableStyle
TableStyle::with_rounded_corners/TableStyle::with_solid_inner_borders. - All fields of
TableStyle,LineStyleandContentLineStyleare public:table.style_mut().top_border.left = Some('╭');
- Presets in
-
The default truncation indicator is now
…instead of....
This should make it more obvious that there's more text and consumes less visual space.
Fix
-
Various performance improvements that reduce table formatting time quite a bit:
- ~36% for "normal" tables (The readme of the project).
17µs -> 11µs - ~34% for "larger" tables, which I would consider a reasonable usecase.
253µs -> 172µs - ~70% for very large tables, i.e. a 10x500 table. ->
20.8ms -> 6.15ms
Most of these improvements boil down to:
- Less string allocations.
- Special handling when handling ASCII-only text, as grapheme handling can be skipped in those cases.
- Moving computational heavy stuff (such as UTF-8 width calculations) out of hot loops.
- ~36% for "normal" tables (The readme of the project).
-
Fixed a non-critical bug that resulted in less-than optimal layouting when UTF-8 characters were involved.
-
No longer panic when rendering a
Tablethat contains a row withRow::max_height(0). -
Don't print multi-width truncation indicators, if they would be longer than the column.
Release notes
Open source →Breaking Changes
-
The following types and functions have been removed:
TableComponentenum- The
modifiersmodule andTable::apply_modifierhave been removed. Table::current_style_as_presetTable::set_styleTable::styleTable::remove_styleTable::load_preset
-
The positional preset string format has been replaced with the new
TableStyle,LineStyleandContentLineStyletypes. The old approach of having "stringified" presets was too finicky and also implicitly bound to the order of variants in the oldTableComponentenum. It was just not a good design.The new design, in comparison, has a nice and (hopefully) intuitive API to define a style. On top of that, all functions on
TableStyleareconst, so custom styles can still be declared as constants:const MY_STYLE: TableStyle = TableStyle::new() .top_border(LineStyle::new('┌', '─', '┬', '┐')) .header_lines(ContentLineStyle::new('│', '┆', '│')) .header_separator(LineStyle::new('╞', '═', '╪', '╡')) .content_lines(ContentLineStyle::new('│', '┆', '│')) .bottom_border(LineStyle::new('└', '─', '┴', '┘'));The new API looks as follows:
- Presets in
comfy_table::presets::*are nowTableStyleconstants. Table::load_style(style)has been added to load a preset or custom style.Table::style()andTable::style_mut()to get a handle to the style used by the table. Themuthandle can be used to change the style.- Instead of modifiers, there are now functions on TableStyle
TableStyle::with_rounded_corners/TableStyle::with_solid_inner_borders. - All fields of
TableStyle,LineStyleandContentLineStyleare public:table.style_mut().top_border.left = Some('╭');
- Presets in
-
The default truncation indicator is now
…instead of.... This should make it more obvious that there's more text and consumes less visual space.
Fix
-
Various performance improvements that reduce table formatting time quite a bit:
- ~36% for "normal" tables (The readme of the project).
17µs -> 11µs - ~34% for "larger" tables, which I would consider a reasonable usecase.
253µs -> 172µs - ~70% for very large tables, i.e. a 10x500 table. ->
20.8ms -> 6.15ms
Most of these improvements boil down to:
- Less string allocations.
- Special handling when handling ASCII-only text, as grapheme handling can be skipped in those cases.
- Moving computational heavy stuff (such as UTF-8 width calculations) out of hot loops.
- ~36% for "normal" tables (The readme of the project).
-
Fixed a non-critical bug that resulted in less-than optimal layouting when UTF-8 characters were involved.
-
No longer panic when rendering a
Tablethat contains a row withRow::max_height(0). -
Don't print multi-width truncation indicators, if they would be longer than the column.
-
-
7.2.213 Jan 2026Release notes
Open source →[7.2.2] - 2026-01-13
Fix
- Minor performance improvements
- Fixed an edge-case, where multiple LowerBoundary constraints weren't uphold.
- Fixed an issue where tables were misformatted when no vertical border styling was specified. #198
[7.2.1] - 2025-09-11
Misc
- Adjust a single test case to not fail in
0x0sized tty-environments. !186
Release notes
Open source →Fix
- Minor performance improvements
- Fixed an edge-case, where multiple LowerBoundary constraints weren't uphold.
- Fixed an issue where tables were misformatted when no vertical border styling was specified. #198
-
7.2.111 Sep 2025Release notes
Open source →Misc
- Adjust a single test case to not fail in
0x0sized tty-environments. !186
- Adjust a single test case to not fail in
-
7.2.028 Aug 2025Release notes
Open source →[7.2.0] - 2025-08-25
Chore
- Switch to Rust 2024 edition. This bumps the MSRV to
1.85and thereby no longer supports thewasm32-wasitarget.
Fix
- Also update the crossterm dependency to 0.29 for windows !181.
Release notes
Open source →Chore
- Switch to Rust 2024 edition. This bumps the MSRV to
1.85and thereby no longer supports thewasm32-wasitarget.
Fix
- Also update the crossterm dependency to 0.29 for windows !181.
- Switch to Rust 2024 edition. This bumps the MSRV to
-
7.1.407 Feb 2025Release notes
Open source →[7.1.4] - 2025-02-07
Fix
- Handle UTF-8 graphemes when truncating cells. #167
- Respect UTF-8 zero-width joiner and variation selection characters when splitting words. #168 by tisonkun
Change
- Remove strum dependency. #169 by tisonkun
- Introduce the
unicode-segmentationlibrary in the scope of #167 and #168. - The new changes for correct UTF-8 handling have a performance hit of up to ~67%.
However, this will be most likely unnoticable for most people.
The benchmark table with 10 columns and 500 rows slowed down from 15ms to 25ms.
For "normal" tables, the performance hit is negligible.
Chore
- Bump ansi-str
Release notes
Open source →Fix
- Handle UTF-8 graphemes when truncating cells. #167
- Respect UTF-8 zero-width joiner and variation selection characters when splitting words. #168 by tisonkun
Change
- Remove strum dependency. #169 by tisonkun
- Introduce the
unicode-segmentationlibrary in the scope of #167 and #168. - The new changes for correct UTF-8 handling have a performance hit of up to ~67%. However, this will most likely unnoticable for most people. The benchmark table with 10 columns and 500 rows slowed down from 15ms to 25ms. For "normal" tables, the performance hit is negligible.
-
7.1.314 Nov 2024 -
7.1.213 Nov 2024Release notes
Open source →[7.1.2] - 2024-11-24
Chore
- Bump
crosstermto0.28 - Bump
unicode-widthto0.2
- Bump
-
7.1.105 Apr 2024 -
7.1.021 Oct 2023Release notes
Open source →[7.1.0] - 2023-10-21
Added
- Add helper methods
(col,row)_countandis_empty. The first set of methods return the number of columns and rows
respectively. The methodis_emptyreturns if the table is empty (contains no data rows). Implemented by
Techassi in #119.
Chore
- Bump crossterm dependency
Release notes
Open source →Added
- Add helper methods
(col,row)_countandis_empty. The first set of methods return the number of columns and rows respectively. The methodis_emptyreturns if the table is empty (contains no data rows). Implemented by Techassi in #119.
Chore
- Bump crossterm dependency
- Add helper methods
-
7.0.116 Jun 2023Release notes
Open source →[7.0.1] - 2023-06-16
Fix
- Fix a panic when working with extreme paddings, where
(padding.left + padding.right) > u16::MAX. - Fix a panic when working with extremely long content, where
(content_width + padding) > u16::MAX. - Properly enforce lower boundary constraints.
Previously, "normal" columns were allocated before lower boundaries were respected.
This could lead to scenarios, where the table would grow beyond the specified size, when there was a lower boundary. - Fix calculation of column widths for empty columns.
The minimum content width for a column is1char, but thecolumn_max_content_widthsfunction on the table returned a0width for fully empty columns.
This resulted in tables becoming larger than specified if there were any empty columns.
Misc
- Extend property tests, which lead to the discovery of some bugs.
- Fix a panic when working with extreme paddings, where
-
7.0.006 Jun 2023Release notes
Open source →Breaking
-
The
ColorandAttributeenum are no longer re-exported from crossterm by default. Previously, when updating comfy-table, crossterm needed to be upgraded as well, since the compile would otherwise fail due to type incompatibilities.To fix this, these enums are now mirrored and internally mapped to their crossterm equivalents, which allows us to safely bump crossterm whenever a new version is released. This change will only affect you if your projects explicitly use crossterm and comfy-table at the same time and feed crossterm's native types into comfy-table.
If one wants the old behavior for convenience reasons, this can be enabled via a feature flag. However, this is also a opt-in to potential breaking changes on minor/patch versions.
-
Bump minimum version to v1.64
Added
reexport_crosstermfeature flag to enable old crossterm re-export.
-
-
6.2.026 May 2023Release notes
Open source →Added
- Add support for custom ansi styling inside of cells. This feature is hidden behind the feature flag
custom_styling. Implemented by blueforesticarus in #93. - Add helper functions
add_row[s]_if, which filtering of rows by a predicate. Implemented by Techassi in #106.
Maintenance
- Bump dependencies
- Add support for custom ansi styling inside of cells. This feature is hidden behind the feature flag
-
6.1.431 Dec 2022 -
6.1.321 Nov 2022 -
6.1.227 Oct 2022 -
6.1.118 Oct 2022Release notes
Open source →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_iterno longer requires a&mut self, but only&self.
Added
- Expose current ContentArrangement for table via
table.content_arrangement.
-
6.1.028 Aug 2022Release notes
Open source →Added
- Add
Table::add_rowsto add multiple rows at the same time.
Misc
- Update crossterm to
v0.24
- Add
-
6.0.030 May 2022Release notes
Open source →Added
- Add
Table::style_text_only(), which prevents non-delimiter whitespaces in cells to be styled. - Add the
Table::discover_columnsfunction 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::contentColumn::get_padding_width->Column::padding_widthColumn::get_constraint->Column::constraintTable::get_header->Table::headerTable::get_table_width->Table::widthTable::set_table_width->Table::set_widthTable::set_style->Table::styleTable::get_column->Table::columnTable::get_column_mut->Table::column_mutTable::get_row->Table::rowTable::get_row_mut->Table::row_mut
Column::get_max_widthandColumn::get_max_content_widthhave been removed as we cannot guarantee that these numbers are always correct. UseTable::column_max_content_widthsinstead
Changed
Table::column_max_content_widthsnow performs a full scan of the table's content when called.- Don't include
Table::is_tty,Table::force_no_ttyandTable::should_styleifttyfeature isn't enabled.
- Add
-
6.0.0-rc.111 Mar 2022 pre-releaseNothing published for this version
-
5.0.118 Feb 2022 -
5.0.007 Nov 2021Release notes
Open source →Updates
- All dependencies have been bumped.
Added
- Add option to use
stderrforis_ttycheck #25.
Breaking
- Remove
ASCII_HORIZONTAL_BORDERS_ONLYin favor ofASCII_HORIZONTAL_ONLY. - Remove
UTF8_HORIZONTAL_BORDERS_ONLYin favor ofUTF8_HORIZONTAL_ONLY.
-
4.1.111 Aug 2021 -
4.1.009 Aug 2021Release notes
Open source →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_ONLYbut 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_ONLYtoASCII_HORIZONTAL_ONLY. Old imports will still work until v5.0. - Rename
UTF8_HORIZONTAL_BORDERS_ONLYtoUTF8_HORIZONTAL_ONLY. Old imports will still work until v5.0.
- Add
-
4.0.108 Jul 2021Release notes
Open source →Fixed
- Some docstrings on the
ColumnConstraintandWidthenum were wrong.
- Some docstrings on the
-
4.0.003 Jul 2021Release notes
Open source →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
NoneforTable::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), } - Add
-
3.0.013 Jun 2021Release notes
Open source →Breaking changes
- Remove most custom traits and replace them with std's generic
Fromtrait.
Check the docs on the trait implementations for Cell, Row and Cells - Add the
Cellstype, to allow super genericIterator -> Rowconversions.
- Remove most custom traits and replace them with std's generic
-
2.1.026 Jan 2021Release notes
Open source →Added
DynamicFullWidtharrangement. This mode is basically the same as theDynamicarrangement mode, but it will always use the full available width, even if there isn't enough content to fill the space.
-
2.0.017 Jan 2021Release notes
Open source →Added
Dynamic arrangement
A new logic to optimize space usage after splitting content has been added.
If there is a lot of unused space after the content has been arranged, this space will now be redistributed to the remaining columns. Or it will be removed if there are no other columns.This is considered a breaking change, since this can result in different table layouts!!
This process is far from perfect, but the behavior is better than before.
Old behavior:
+-----------------------------------+-----------------------------------+------+ | Header1 | Header2 | Head | +==============================================================================+ | This is a very long line with a | This is text with a | smol | | lot of text | anotherverylongtexttesttest | | +-----------------------------------+-----------------------------------+------+New behavior:
+-----------------------------------------+-----------------------------+------+ | Header1 | Header2 | Head | +==============================================================================+ | This is a very long line with a lot of | This is text with a | smol | | text | anotherverylongtexttesttest | | +-----------------------------------------+-----------------------------+------+Old behavior:
+------------------------------------------------+ | Header1 | +================================================+ | This is text with a | | anotherverylongtexttesttestaa | +------------------------------------------------+New behavior:
+-------------------------------+ | Header1 | +===============================+ | This is text with a | | anotherverylongtexttesttestaa | +-------------------------------+ -
1.6.016 Jan 2021 -
1.5.029 Dec 2020Release notes
Open source →Added
- Add
table::trim_fmt, which trims all trailing whitespaces on tables with no right border.
- Add
-
1.4.206 Dec 2020Nothing published for this version
-
1.4.106 Dec 2020Nothing published for this version
-
1.4.006 Dec 2020Release notes
Open source →Added
- Allow to set custom delimiters on tables, columns and cells.
Changed
- Expose all important traits. I.e.
ToRow,ToCellandToCells.
-
1.3.008 Nov 2020 -
1.2.027 Oct 2020Release notes
Open source →Added
- Add the option to set a max-height on rows. Long content will be truncated.
-
1.1.123 Aug 2020 -
1.1.023 Aug 2020Release notes
Open source →Changed
- Move
is_ttylogic fromattytocrossterm. - Remove
skeptic, since it fails in CI and bloats compile time. Compile time is reduced by ca. 40%.
- Move
-
1.0.007 Jul 2020Release notes
Open source →Changed
- The project has been in use for quite some time and seems to be quite stable!
- Use cargo's
examplefunctionality for examples.
-
0.1.124 May 2020Release notes
Open source →Added
Column::get_max_width(), which returns the character count of the widest line in this column including padding.current_style_as_presetmethod for convenient conversion of a style into a preset- New Markdown like table style prefix. Thanks to joeydumont.
-
0.1.021 Mar 2020Release notes
Open source →Added
- Better test coverage
Fixed
- Fixed a bug with broken percentage constraints for super wide tables.
-
0.0.709 Feb 2020Release notes
Open source →Added
- Introduce proptest
Fixed
- Fix wrong calculation due to bytes count instead of char count
- Fix panics caused by wrong string splits
-
0.0.630 Jan 2020 -
0.0.529 Jan 2020Release notes
Open source →Added
- Add
Column::remove_constraint() - Preset
UTF8_NO_BORDERS - Preset
UTF8_HORIZONTAL_BORDERS_ONLY
- Add
-
0.0.427 Jan 2020Release notes
Open source →Added
- Add skeptic tests
- Add code coverage
- A lot more tests
Changed
- Removed
HiddenConstraint
-
0.0.326 Jan 2020Nothing published for this version
-
0.0.226 Jan 2020Nothing published for this version
-
0.0.119 Jan 2020Nothing published for this version