mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 19:21:26 +00:00
feat(data-table): allow custom column widths (#1265)
* feat(data-table): allow header column `width`, `minWidth` values * Run "yarn build:docs" * test(data-table): assert width, minWidth properties * docs(data-table): add "Custom column widths" example
This commit is contained in:
parent
6239c11024
commit
c6f210899b
9 changed files with 90 additions and 14 deletions
|
@ -16,6 +16,12 @@
|
|||
|
||||
/** Set to `true` to enable a sticky header */
|
||||
export let stickyHeader = false;
|
||||
|
||||
/**
|
||||
* Set the style attribute on the `table` element
|
||||
* @type {string}
|
||||
*/
|
||||
export let tableStyle = undefined;
|
||||
</script>
|
||||
|
||||
{#if stickyHeader}
|
||||
|
@ -30,6 +36,7 @@
|
|||
class:bx--data-table--zebra="{zebra}"
|
||||
class:bx--data-table--static="{useStaticWidth}"
|
||||
class:bx--data-table--sticky-header="{stickyHeader}"
|
||||
style="{tableStyle}"
|
||||
>
|
||||
<slot />
|
||||
</table>
|
||||
|
@ -46,6 +53,7 @@
|
|||
class:bx--data-table--static="{useStaticWidth}"
|
||||
class:bx--data-table--sticky-header="{stickyHeader}"
|
||||
{...$$restProps}
|
||||
style="{tableStyle}"
|
||||
>
|
||||
<slot />
|
||||
</table>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue