Here is a short script that shows what I am seeing.
import panel as pn
import pandas as pd
data = ["abcdefgh"] * 40 # At 39, it works fine. At 40 it doesn't size for all the items just the first ones
data.extend(["abcdefghabcdefghabcdefghabcdefgh"] * 100)
df = pd.DataFrame(data, columns=["Systems"])
table_pane = pn.widgets.Tabulator(df,
disabled=True, # disables editing of the table
header_filters=True,
# fit_data fit_data_table -> don't fit to all the data. Just the first few lines
# fit_data_stretch and fit_data_fill -> stretches but don't want that either. Columns too wide
layout='fit_data',
pagination=None,
selectable=False,
show_index=True,
sizing_mode='stretch_both', # this works great!
theme='bootstrap5',
)
template = pn.template.FastListTemplate(
title="Dashboard",
main=[table_pane],
accent_base_color="black",
header_background="rgb(0, 212, 169)",
background_color="white",
theme=pn.theme.DefaultTheme,
theme_toggle=False,
main_layout=None,
)
Notice my comment on line 4. The width of the column seems to only depend on what is in the first 40 rows in the table. So if there are long cell values in rows past 40, the width of the column is only based on the first 40. Is that the way it is supposed to work? Anyway to change that behavior?