diff --git a/README.md b/README.md index bb89c47a4fc..2c5caac3aa0 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ Read the documents for more info - [x] Stat - [ ] Steps - [ ] Tag -- [ ] Table +- [x] Table - [x] Tabs - [ ] Timeline - [ ] Toast @@ -197,7 +197,7 @@ Read the documents for more info [jsdeliver-url]: https://www.jsdelivr.com/package/npm/daisyui [build-url]: https://github.com/saadeghi/daisyui/actions [tweet-url]: https://twitter.com/intent/tweet?text=DaisyUI%20%0D%0AUI%20Components%20for%20Tailwind%20CSS%20%0D%0Ahttps://github.com/saadeghi/daisyui -[number-of-components]: https://badgen.net/badge/components%20added/33/purple +[number-of-components]: https://badgen.net/badge/components%20added/34/purple [docs-url-install]: https://daisyui.com/docs/install [docs-url]: https://daisyui.com/ diff --git a/src/components/base/table.css b/src/components/base/table.css new file mode 100644 index 00000000000..d355384cffd --- /dev/null +++ b/src/components/base/table.css @@ -0,0 +1,6 @@ +.table{ + @apply relative; + th:first-child{ + @apply sticky left-0 z-10; + } +} \ No newline at end of file diff --git a/src/components/styled/table.css b/src/components/styled/table.css new file mode 100644 index 00000000000..0abbd997fd1 --- /dev/null +++ b/src/components/styled/table.css @@ -0,0 +1,38 @@ +.table{ + @apply text-left; + th,td{ + @apply p-4 whitespace-nowrap; + } + &:not(.table-zebra) :is(thead,tbody,tfoot) tr:not(:last-child) :is(th,td){ + @apply border-b border-base-200; + } + :is(thead,tfoot) :is(th,td){ + @apply bg-base-200 text-xs uppercase font-bold; + &:first-child{ + @apply rounded-l-lg; + } + &:last-child{ + @apply rounded-r-lg; + } + } + /* th:first-child{ + box-shadow: -1px 0 hsl(var(--b2, 210 20% 98%)) inset; + } */ + tbody :is(th,td){ + @apply bg-base-100; + } + &-zebra tbody tr:nth-child(even) :is(th,td){ + @apply bg-base-200; + &:first-child{ + @apply rounded-l-lg; + } + &:last-child{ + @apply rounded-r-lg; + } + } + &-compact{ + th,td{ + @apply p-2 text-sm; + } + } +} \ No newline at end of file diff --git a/src/docs/layouts/default.vue b/src/docs/layouts/default.vue index 781cfcd0131..45a3c6f33ff 100644 --- a/src/docs/layouts/default.vue +++ b/src/docs/layouts/default.vue @@ -129,6 +129,7 @@ export default { 'dropdown', 'tooltip', 'stat', + 'table', ], } }, diff --git a/src/docs/pages/components/table.vue b/src/docs/pages/components/table.vue new file mode 100644 index 00000000000..f6f91fe300f --- /dev/null +++ b/src/docs/pages/components/table.vue @@ -0,0 +1,196 @@ + + +