From 874447cb41a77868513459eee5d3301fe8b8e9a1 Mon Sep 17 00:00:00 2001 From: "Haytham A. Salama" Date: Thu, 28 Sep 2023 13:11:26 +0300 Subject: [PATCH] feat(Table): add ability to custom style for `td` and `tr` (#741) Co-authored-by: Benjamin Canac --- .../content/examples/TableExampleStyle.vue | 40 +++++++++++++ docs/content/4.data/1.table.md | 59 +++++++++++++++++++ src/runtime/components/data/Table.vue | 4 +- 3 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 docs/components/content/examples/TableExampleStyle.vue diff --git a/docs/components/content/examples/TableExampleStyle.vue b/docs/components/content/examples/TableExampleStyle.vue new file mode 100644 index 0000000000..905f92880d --- /dev/null +++ b/docs/components/content/examples/TableExampleStyle.vue @@ -0,0 +1,40 @@ + + + diff --git a/docs/content/4.data/1.table.md b/docs/content/4.data/1.table.md index 05d8ba2079..cb2f369d69 100644 --- a/docs/content/4.data/1.table.md +++ b/docs/content/4.data/1.table.md @@ -524,6 +524,65 @@ excludedProps: --- :: +## Styling + +You can apply styles to `tr` and `td` elements by passing a `class` to rows. + +Also, you can apply styles to `th` elements by passing a `class` to columns. + +::component-example +--- +padding: false +--- + +#default +:table-example-style{class="w-full"} + +#code +```vue + + + +``` +:: + ## Slots You can use slots to customize the header and data cells of the table. diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index da229a969d..2500d7c58b 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -49,12 +49,12 @@