Skip to content

Commit

Permalink
Merge pull request #1120 from nsbno/layout-table
Browse files Browse the repository at this point in the history
Improve layout of content for responsive when content overflow
  • Loading branch information
alicemacl authored Apr 23, 2024
2 parents 4252a25 + d998cb8 commit a3a18a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/large-bobcats-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vygruppen/spor-react": patch
---

Improve layout of tables when content overflow and in responsive views
2 changes: 1 addition & 1 deletion packages/spor-react/src/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const Table = forwardRef<TableProps, "table">((props, ref) => {
const { variant, size, colorScheme, children, ...rest } = props;
return (
<Box {...rest} {...getStyleProps(props)}>
<Box overflowX="auto">
<Box overflowX="auto" role="region">
<ChakraTable
variant={variant}
size={size}
Expand Down
4 changes: 4 additions & 0 deletions packages/spor-react/src/theme/components/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ const config = helpers.defineMultiStyleConfig({
borderCollapse: "collapse",
...baseText("default", props),
width: "100%",
minWidth: "600px",
},
th: {
fontWeight: "bold",
textAlign: "start",
verticalAlign: "top",
minWidth: "68px",
},
td: {
textAlign: "start",
verticalAlign: "top",
},
tfoot: {
tr: {
Expand Down

0 comments on commit a3a18a5

Please sign in to comment.