Minimal Chrome
Turn off every optional element — no row numbers, no dtypes, no dimension badges:
from great_docs import tbl_preview
from gdtest_tbl_preview import sample_scores
tbl_preview(
sample_scores(8),
show_row_numbers=False,
show_dtypes=False,
show_dimensions=False,
show_all=True,
)
| name |
subject |
score |
grade |
passed |
| Bob |
Math |
70.3 |
A+ |
True |
| Alice |
Art |
41.6 |
A- |
False |
| Eve |
History |
51.9 |
C+ |
False |
| Diana |
Math |
79 |
B- |
True |
| Diana |
Math |
72.7 |
B |
True |
| Charlie |
Math |
53.2 |
A- |
False |
| Bob |
Science |
75.4 |
B+ |
True |
| Iris |
Science |
88.6 |
B- |
True |
Full Chrome with Caption
Everything enabled plus a caption:
tbl_preview(
sample_scores(50),
n_head=10,
n_tail=5,
caption="Top & bottom of the class roster",
)
TableRows50Columns5 |
| Top & bottom of the class roster |
|
|
|
|
|
|
| 0 |
Bob |
English |
54.8 |
B |
False |
| 1 |
Alice |
Art |
73.7 |
B+ |
True |
| 2 |
Eve |
English |
55.8 |
A+ |
False |
| 3 |
Diana |
Art |
75.1 |
B+ |
True |
| 4 |
Diana |
Science |
93.9 |
F |
True |
| 5 |
Charlie |
Math |
64 |
A |
True |
| 6 |
Bob |
Math |
53.2 |
A |
False |
| 7 |
Iris |
Science |
99.9 |
C |
True |
| 8 |
Bob |
English |
70.6 |
A |
True |
| 9 |
Jack |
Math |
45.5 |
D |
False |
| 45 |
Iris |
History |
40 |
B- |
False |
| 46 |
Bob |
History |
59.4 |
A |
False |
| 47 |
Grace |
Science |
41.2 |
D |
False |
| 48 |
Bob |
English |
95.7 |
B+ |
True |
| 49 |
Iris |
Science |
92.7 |
B |
True |
Custom Column Width
Restrict columns to 120px max width:
tbl_preview(
sample_scores(15),
max_col_width=120,
min_tbl_width=400,
)
TableRows15Columns5 |
|
|
|
|
|
|
| 0 |
Bob |
Science |
60.4 |
F |
True |
| 1 |
Alice |
Art |
49.3 |
B- |
False |
| 2 |
Eve |
Art |
97.4 |
F |
True |
| 3 |
Diana |
Math |
60.2 |
B+ |
True |
| 4 |
Diana |
Art |
45.6 |
A |
False |
| 10 |
Grace |
Art |
72.2 |
A |
True |
| 11 |
Alice |
English |
98.4 |
C+ |
True |
| 12 |
Alice |
Math |
62.7 |
B |
True |
| 13 |
Bob |
Science |
73.1 |
C |
True |
| 14 |
Diana |
History |
89.8 |
B- |
True |
Side-by-Side Comparison
Default Pandas output vs. tbl_preview() on the same data:
| 0 |
Bob |
History |
51.9 |
A- |
False |
| 1 |
Alice |
Math |
79.0 |
B+ |
True |
| 2 |
Eve |
Math |
72.7 |
B- |
True |
| 3 |
Diana |
Math |
53.2 |
A |
False |
| 4 |
Diana |
Science |
75.4 |
A |
True |
| 5 |
Charlie |
Science |
88.6 |
C+ |
True |
| 6 |
Bob |
Art |
40.4 |
A |
False |
| 7 |
Iris |
Art |
88.3 |
B- |
True |
| 8 |
Bob |
Math |
81.9 |
B- |
True |
| 9 |
Jack |
Art |
60.4 |
F |
True |
PandasRows10Columns5 |
|
|
|
|
|
|
| 0 |
Bob |
History |
51.9 |
A- |
False |
| 1 |
Alice |
Math |
79 |
B+ |
True |
| 2 |
Eve |
Math |
72.7 |
B- |
True |
| 3 |
Diana |
Math |
53.2 |
A |
False |
| 4 |
Diana |
Science |
75.4 |
A |
True |
| 5 |
Charlie |
Science |
88.6 |
C+ |
True |
| 6 |
Bob |
Art |
40.4 |
A |
False |
| 7 |
Iris |
Art |
88.3 |
B- |
True |
| 8 |
Bob |
Math |
81.9 |
B- |
True |
| 9 |
Jack |
Art |
60.4 |
F |
True |