format
Formats the specified columns or cells within this dataframe such that they have specific CSS attributes applied to them when rendering the dataframe to HTML.
This function does not immediately produce a FormattedFrame, but instead it selects the columns to be formatted and returns a FormatClause which serves as an intermediate step.
This can include column groups and nested columns.
See Selecting Columns.
The FormatClause allows you to further narrow down the selection to individual cells by selecting only certain rows, using where, and then finally specify how to format the cells using with, perRowCol, or linearBg.
You can continue formatting the FormattedFrame by calling format on it again.
Specifying a column group makes all of its inner columns be formatted in the same way unless overridden.
Formatting is done additively, meaning you can add more formatting to a cell that's already formatted or override certain attributes inherited from its outer group.
Specifying a frame column at the moment does nothing (Issue #1375), convert each nested DataFrame to a FormattedFrame instead:
df.convert { myFrameCol }.with {
it.format { someCol }.with { background(green) }
}.toStandaloneHtml()Check out the Grammar.
For more information: See format on the documentation website.
This Format Overload
Select or express columns using the Columns Selection DSL.
This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.
The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.
Check out: Columns Selection DSL Grammar
See Column Selectors on the documentation website.
Examples:
df.format { temperature }.linearBg(-20 to FormattingDsl.blue, 50 to FormattingDsl.red)
.format { age }.notNull().perRowCol { row, col ->
textColor(
linear(col[row], col.min() to green, col.max() to red)
)
}.toStandaloneHtml().openInBrowser()Parameters
The columns-selector used to select the columns to be formatted. If unspecified, all columns will be formatted.
Formats the specified columns or cells within this dataframe such that they have specific CSS attributes applied to them when rendering the dataframe to HTML.
This function does not immediately produce a FormattedFrame, but instead it selects the columns to be formatted and returns a FormatClause which serves as an intermediate step.
This can include column groups and nested columns.
See Selecting Columns.
The FormatClause allows you to further narrow down the selection to individual cells by selecting only certain rows, using where, and then finally specify how to format the cells using with, perRowCol, or linearBg.
You can continue formatting the FormattedFrame by calling format on it again.
Specifying a column group makes all of its inner columns be formatted in the same way unless overridden.
Formatting is done additively, meaning you can add more formatting to a cell that's already formatted or override certain attributes inherited from its outer group.
Specifying a frame column at the moment does nothing (Issue #1375), convert each nested DataFrame to a FormattedFrame instead:
df.convert { myFrameCol }.with {
it.format { someCol }.with { background(green) }
}.toStandaloneHtml()Check out the Grammar.
For more information: See format on the documentation website.
This Format Overload
Select single or multiple columns using their names as Strings. (String API).
Examples:
df.format("temperature").with { linearBg(it as Number, -20 to blue, 50 to red) }
.format("age").notNull().perRowCol { row, col ->
col as DataColumn<Int>
textColor(
linear(col[row], col.min() to green, col.max() to red)
)
}.toStandaloneHtml().openInBrowser()Parameters
The names of the columns to be formatted. If unspecified, all columns will be formatted.
Formats the specified columns or cells within this dataframe such that they have specific CSS attributes applied to them when rendering the dataframe to HTML.
This function does not immediately produce a FormattedFrame, but instead it selects the columns to be formatted and returns a FormatClause which serves as an intermediate step.
This can include column groups and nested columns.
See Selecting Columns.
The FormatClause allows you to further narrow down the selection to individual cells by selecting only certain rows, using where, and then finally specify how to format the cells using with, perRowCol, or linearBg.
You can continue formatting the FormattedFrame by calling format on it again.
Specifying a column group makes all of its inner columns be formatted in the same way unless overridden.
Formatting is done additively, meaning you can add more formatting to a cell that's already formatted or override certain attributes inherited from its outer group.
Specifying a frame column at the moment does nothing (Issue #1375), convert each nested DataFrame to a FormattedFrame instead:
df.convert { myFrameCol }.with {
it.format { someCol }.with { background(green) }
}.toStandaloneHtml()Check out the Grammar.
For more information: See format on the documentation website.
This Format Overload
This simply formats all columns. Optionally, you can specify which columns to format using a columns-selector or by column names.
Examples:
df.format().with { background(white) and textColor(black) and bold }
.format { temperature }.linearBg(-20 to FormattingDsl.blue, 50 to FormattingDsl.red)
.format { age }.notNull().perRowCol { row, col ->
textColor(
linear(col[row], col.min() to green, col.max() to red)
)
}.toStandaloneHtml().openInBrowser()Formats the specified columns or cells within this dataframe such that they have specific CSS attributes applied to them when rendering the dataframe to HTML.
This function does not immediately produce a FormattedFrame, but instead it selects the columns to be formatted and returns a FormatClause which serves as an intermediate step.
This can include column groups and nested columns.
See Selecting Columns.
The FormatClause allows you to further narrow down the selection to individual cells by selecting only certain rows, using where, and then finally specify how to format the cells using with, perRowCol, or linearBg.
You can continue formatting the FormattedFrame by calling format on it again.
Specifying a column group makes all of its inner columns be formatted in the same way unless overridden.
Formatting is done additively, meaning you can add more formatting to a cell that's already formatted or override certain attributes inherited from its outer group.
Specifying a frame column at the moment does nothing (Issue #1375), convert each nested DataFrame to a FormattedFrame instead:
df.convert { myFrameCol }.with {
it.format { someCol }.with { background(green) }
}.toStandaloneHtml()Check out the Grammar.
For more information: See format on the documentation website.
This Format Overload
Select or express columns using the Columns Selection DSL.
This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.
The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.
Check out: Columns Selection DSL Grammar
See Column Selectors on the documentation website.
Examples:
df.format().with { background(white) and textColor(black) and bold }
.format { temperature }.linearBg(-20 to FormattingDsl.blue, 50 to FormattingDsl.red)
.format { age }.notNull().perRowCol { row, col ->
textColor(
linear(col[row], col.min() to green, col.max() to red)
)
}.toStandaloneHtml().openInBrowser()Parameters
The columns-selector used to select the columns to be formatted. If unspecified, all columns will be formatted.
Formats the specified columns or cells within this dataframe such that they have specific CSS attributes applied to them when rendering the dataframe to HTML.
This function does not immediately produce a FormattedFrame, but instead it selects the columns to be formatted and returns a FormatClause which serves as an intermediate step.
This can include column groups and nested columns.
See Selecting Columns.
The FormatClause allows you to further narrow down the selection to individual cells by selecting only certain rows, using where, and then finally specify how to format the cells using with, perRowCol, or linearBg.
You can continue formatting the FormattedFrame by calling format on it again.
Specifying a column group makes all of its inner columns be formatted in the same way unless overridden.
Formatting is done additively, meaning you can add more formatting to a cell that's already formatted or override certain attributes inherited from its outer group.
Specifying a frame column at the moment does nothing (Issue #1375), convert each nested DataFrame to a FormattedFrame instead:
df.convert { myFrameCol }.with {
it.format { someCol }.with { background(green) }
}.toStandaloneHtml()Check out the Grammar.
For more information: See format on the documentation website.
This Format Overload
This simply formats all columns. Optionally, you can specify which columns to format using a columns-selector or by column names.
Examples:
df.format { temperature }.with { textColor(linear(-20 to FormattingDsl.blue, 50 to FormattingDsl.red)) }
.format { age }.notNull().perRowCol { row, col ->
textColor(
linear(col[row], col.min() to green, col.max() to red)
)
}
.format().with { background(white) and bold }
.toStandaloneHtml().openInBrowser()Deprecated
It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html