How can I customize text wrapping and text style in Bokeh table?

I have a base Bokeh table in Django Python.

I have it displayed in its basic form - as by default without any style editing.

At me all words are superimposed on other columns of the data. What’s in the header of the table - what’s in the body of the table. I can not change the font of the table - the title and body of the table.

How can I set up a data-wrapped display of table text on another line? And how can I change the font of the text inside the table - the table header and table body?

My table does not expand to the entire DIV container in which it is located. Sometimes layering on other template objects. How can this be set up?

def table_htmx(request):
    context = {}
    qs_select_tabl = 
    qs = qs_select_tabl.values()
    df = pd.DataFrame.from_records(qs)

    header = [field.verbose_name for field in Table_model._meta.get_fields()]
    df.columns = header

    template = """
                  <div style="font-size: 100%">
                  <%= value %>
    template_html = HTMLTemplateFormatter(template=template)

    columns = [TableColumn(field=col, title=col, formatter=template_html) for col in header]
    source = ColumnDataSource(df)
    data_table = DataTable(source=source, columns=columns, width=800)

    script, div = components(data_table)

    context['script'] = script
    context['div'] = div
    return render(request, "table_htmx.html", context)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.