--- layout: '@/layouts/Doc.astro' title: Table --- import Example from '@/components/Example.astro' import tableStyle from '@webtui/css/components/table.css?raw' Displays a table Name Age Country John 25 USA Jane 30 Canada Joe 27.8 Lithuania for some unexplainable reason `} /> ## Import ```css @import '@webtui/css/components/table.css'; ``` ## Usage ```html ...
... ... ...
... ... ...
``` ## Caveats The `` element absolutely obliterates the ascii box-like styling ## Reference ### Properties - `--table-border-width`: The width of the table borders - `--table-border-color`: The color of the table borders ```css table { --table-border-width: 1px; --table-border-color: var(--foreground2); } ``` ### Extending To extend the Table stylesheet, define a CSS rule on the `components` layer ```css @layer components { table { /* ... */ } } ``` ### Scope - All `` elements - All ``, ``, ``, ``, `
`, and `` elements that are children of a `` ```css table { thead, tbody, tfoot { /* ... */ } tr { th { /* ... */ } td { /* ... */ } } } ```