[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.