Long Strings (Default Width)
Cells with very long text are capped at max_col_width (250px by default) and show an ellipsis instead of wrapping.
from great_docs import tbl_preview
data = {
"id": [1, 2, 3, 4, 5],
"title": [
"A short title",
"A moderately long title that tests mid-range widths",
"This title is intentionally very long so that it will definitely exceed the maximum column width and trigger text-overflow ellipsis behavior in the rendered table cell",
"Brief",
"Another extremely verbose title string that goes on and on to stress-test the truncation and overflow handling in the preview table renderer",
],
"status": ["draft", "published", "review", "archived", "published"],
}
tbl_preview(data, show_all=True)
TableRows5Columns3 |
|
|
|
|
| 0 |
1 |
A short title |
draft |
| 1 |
2 |
A moderately long title that tests mid-range widths |
published |
| 2 |
3 |
This title is intentionally very long so that it will definitely exceed the maximum column width and trigger text-overflow ellipsis behavior in the rendered table cell |
review |
| 3 |
4 |
Brief |
archived |
| 4 |
5 |
Another extremely verbose title string that goes on and on to stress-test the truncation and overflow handling in the preview table renderer |
published |
Descriptions and Paragraphs
Real-world data often has paragraph-length text in columns.
data = {
"package": ["NumPy", "Pandas", "Polars", "Great Tables", "Pointblank"],
"description": [
"Fundamental package for scientific computing with Python. Provides N-dimensional arrays, linear algebra, Fourier transforms, and random number generation.",
"Powerful data structures for data analysis, time series, and statistics. Built on NumPy with labeled axes, automatic alignment, and rich I/O.",
"Lightning-fast DataFrame library in Rust with a Python API. Lazy evaluation, multi-threaded queries, and Apache Arrow memory format.",
"Build beautiful, publication-quality tables in Python. Supports Polars and Pandas DataFrames with fine-grained styling, formatting, and export.",
"Data validation library for Python. Define expectations, validate data, and generate detailed reports with table-level and column-level checks.",
],
"version": ["1.26.0", "2.2.0", "0.20.0", "0.15.0", "0.14.0"],
}
tbl_preview(data, show_all=True)
TableRows5Columns3 |
|
|
|
|
| 0 |
NumPy |
Fundamental package for scientific computing with Python. Provides N-dimensional arrays, linear algebra, Fourier transforms, and random number generation. |
1.26.0 |
| 1 |
Pandas |
Powerful data structures for data analysis, time series, and statistics. Built on NumPy with labeled axes, automatic alignment, and rich I/O. |
2.2.0 |
| 2 |
Polars |
Lightning-fast DataFrame library in Rust with a Python API. Lazy evaluation, multi-threaded queries, and Apache Arrow memory format. |
0.20.0 |
| 3 |
Great Tables |
Build beautiful, publication-quality tables in Python. Supports Polars and Pandas DataFrames with fine-grained styling, formatting, and export. |
0.15.0 |
| 4 |
Pointblank |
Data validation library for Python. Define expectations, validate data, and generate detailed reports with table-level and column-level checks. |
0.14.0 |
Narrow Max Width (120px)
Force aggressive truncation with a tight max_col_width:
tbl_preview(data, show_all=True, max_col_width=120)
TableRows5Columns3 |
|
|
|
|
| 0 |
NumPy |
Fundamental package for scientific computing with Python. Provides N-dimensional arrays, linear algebra, Fourier transforms, and random number generation. |
1.26.0 |
| 1 |
Pandas |
Powerful data structures for data analysis, time series, and statistics. Built on NumPy with labeled axes, automatic alignment, and rich I/O. |
2.2.0 |
| 2 |
Polars |
Lightning-fast DataFrame library in Rust with a Python API. Lazy evaluation, multi-threaded queries, and Apache Arrow memory format. |
0.20.0 |
| 3 |
Great Tables |
Build beautiful, publication-quality tables in Python. Supports Polars and Pandas DataFrames with fine-grained styling, formatting, and export. |
0.15.0 |
| 4 |
Pointblank |
Data validation library for Python. Define expectations, validate data, and generate detailed reports with table-level and column-level checks. |
0.14.0 |
Wide Max Width (500px)
Allow generous room — long text is still capped, but more is visible:
tbl_preview(data, show_all=True, max_col_width=500)
TableRows5Columns3 |
|
|
|
|
| 0 |
NumPy |
Fundamental package for scientific computing with Python. Provides N-dimensional arrays, linear algebra, Fourier transforms, and random number generation. |
1.26.0 |
| 1 |
Pandas |
Powerful data structures for data analysis, time series, and statistics. Built on NumPy with labeled axes, automatic alignment, and rich I/O. |
2.2.0 |
| 2 |
Polars |
Lightning-fast DataFrame library in Rust with a Python API. Lazy evaluation, multi-threaded queries, and Apache Arrow memory format. |
0.20.0 |
| 3 |
Great Tables |
Build beautiful, publication-quality tables in Python. Supports Polars and Pandas DataFrames with fine-grained styling, formatting, and export. |
0.15.0 |
| 4 |
Pointblank |
Data validation library for Python. Define expectations, validate data, and generate detailed reports with table-level and column-level checks. |
0.14.0 |
Mixed Short and Long Columns
Short numeric/code columns alongside verbose text — each column gets its own computed width.
data = {
"code": ["E001", "E002", "E003", "W001", "W002", "I001", "I002", "E004"],
"severity": ["error", "error", "error", "warning", "warning", "info", "info", "error"],
"message": [
"Undefined variable: foobar",
"Type mismatch: expected int, got str in argument `count` of function process_batch()",
"Division by zero in expression total / n_items where n_items evaluates to 0",
"Unused import: os (imported but never referenced in module)",
"Variable `tmp` assigned on line 42 but never used anywhere in the function body",
"Module docstring missing: consider adding a module-level docstring",
"Line too long: 127 characters (max 120). Consider breaking this into multiple lines for readability",
"Syntax error: unexpected token ) at position 34 in expression parse(input))",
],
"line": [12, 45, 78, 3, 42, 1, 99, 34],
}
tbl_preview(data, show_all=True)
TableRows8Columns4 |
|
|
|
|
|
| 0 |
E001 |
error |
Undefined variable: foobar |
12 |
| 1 |
E002 |
error |
Type mismatch: expected int, got str in argument `count` of function process_batch() |
45 |
| 2 |
E003 |
error |
Division by zero in expression total / n_items where n_items evaluates to 0 |
78 |
| 3 |
W001 |
warning |
Unused import: os (imported but never referenced in module) |
3 |
| 4 |
W002 |
warning |
Variable `tmp` assigned on line 42 but never used anywhere in the function body |
42 |
| 5 |
I001 |
info |
Module docstring missing: consider adding a module-level docstring |
1 |
| 6 |
I002 |
info |
Line too long: 127 characters (max 120). Consider breaking this into multiple lines for readability |
99 |
| 7 |
E004 |
error |
Syntax error: unexpected token ) at position 34 in expression parse(input)) |
34 |