Skip to content

Commit 746541f

Browse files
committed
add a css class with the column name to table headers, and document the behavior
fixes #264
1 parent 38fad27 commit 746541f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,12 @@ The `color` property sets the color of each series separately, in order.
544544
]'));
545545

546546
INSERT INTO component(name, icon, description) VALUES
547-
('table', 'table', 'A table with optional filtering and sorting. Unlike most others, this component does not have a fixed set of item properties, any property that is used will be rendered directly as a column in the table.');
547+
('table', 'table', 'A table with optional filtering and sorting.
548+
Unlike most others, this component does not have a fixed set of item properties, any property that is used will be rendered directly as a column in the table.
549+
Tables can contain rich text, including images, links, and icons. Table rows can be styled with a background color, and the table can be made striped, hoverable, and bordered.
550+
551+
Advanced users can apply custom styles to table columns using a CSS class with the same name as the column, and to table rows using the `_sqlpage_css_class` property.
552+
');
548553

549554
INSERT INTO parameter(component, name, description, type, top_level, optional) SELECT 'table', * FROM (VALUES
550555
-- top level

sqlpage/templates/table.handlebars

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
{{#each this}}
1919
{{#if (not (starts_with @key '_sqlpage_'))}}
2020
<th class="
21+
{{~@key~}}
2122
{{~#if (array_contains ../../align_right @key)}} text-end {{/if~}}
2223
">
2324
{{~#if ../../sort~}}

0 commit comments

Comments
 (0)