diff --git a/src/components/Table.astro b/src/components/Table.astro index daebd1b..52c1fd5 100644 --- a/src/components/Table.astro +++ b/src/components/Table.astro @@ -14,6 +14,7 @@ const { columnsRendererKey, classInfos = "", tableClassNames = "", + hideHeader = false, } = Astro.props as TableProps; const id = `table-${Math.random().toString(36).slice(2, 9)}`; @@ -46,42 +47,42 @@ const id = `table-${Math.random().toString(36).slice(2, 9)}`; tableClassNames, )} > - - - { - selectable && ( - - - - ) - } - { - columns.map((col) => ( - -
- {col.label} - {col.sortable && ( - + { + !hideHeader && ( + + + {selectable && ( + + + + )} + {columns.map((col) => ( + - - )) - } - - + style={ + col.width ? `width:${col.width}` : "" + } + data-sort-key={ + col.sortable ? col.key : undefined + } + > +
+ {col.label} + {col.sortable && ( + + )} +
+ + ))} + + + ) + }
diff --git a/src/pages/table.astro b/src/pages/table.astro index 5339fa8..c80aac7 100644 --- a/src/pages/table.astro +++ b/src/pages/table.astro @@ -259,6 +259,7 @@ const studentColumns = [ columns={columns} data={data} columnsRendererKey="columnsRenderer" + hideHeader={true} />
diff --git a/src/types/table/types.ts b/src/types/table/types.ts index 62fe66e..522b189 100644 --- a/src/types/table/types.ts +++ b/src/types/table/types.ts @@ -33,4 +33,5 @@ export interface TableProps { columnsRendererKey?: string classInfos?: string; tableClassNames?: string; + hideHeader?: boolean; } \ No newline at end of file