Skip to content

Commit

Permalink
Bring back responsiveness functionality of tables (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadxAli committed Aug 9, 2024
2 parents a6bc1da + 842ae20 commit b27f6ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/elements/Table/Table.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
@import "styles/variables";

.prezly-slate-table-container {
width: 100%;
overflow-x: auto;
}

.prezly-slate-table {
width: 100%;
max-width: 100%;
border-collapse: collapse;
table-layout: auto;

Expand Down
16 changes: 9 additions & 7 deletions src/elements/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ interface Props extends HTMLAttributes<HTMLTableElement> {

export function Table({ children, node }: Props) {
return (
<table
className={classNames('prezly-slate-table', {
'prezly-slate-table--withBorders': node.border,
})}
>
<tbody>{children}</tbody>
</table>
<div className="prezly-slate-table-container">
<table
className={classNames('prezly-slate-table', {
'prezly-slate-table--withBorders': node.border,
})}
>
<tbody>{children}</tbody>
</table>
</div>
);
}

0 comments on commit b27f6ac

Please sign in to comment.