Skip to main content
Version: Python

to_html

The to_html method writes a Deephaven table to a string HTML table.

Syntax

to_html(table: Table) -> str

Parameters

ParameterTypeDescription
tableTable

The Deephaven table to convert to an HTML table.

Returns

A new HTML string.

Examples

The to_html function requires only a single argument - the table to convert. Here, we'll create a simple table and convert it to HTML.

from deephaven import new_table
from deephaven.column import string_col, int_col, datetime_col
from deephaven import html

table = new_table(
[
string_col("Letter", ["A", "B", "C"]),
int_col("Num", [1, 2, 3]),
datetime_col(
"Datetime",
[
"2007-12-03T10:15:30.00Z",
"2007-12-03T10:15:30.00Z",
"2007-12-03T10:15:30.00Z",
],
),
]
)

html_table = html.to_html(table)

print(html_table)
note

Since HTML tables represent all data as plain, untyped text, all typing will be lost.