From 432b6624409e19a7d02032f7c8c3956c90a59fbf Mon Sep 17 00:00:00 2001 From: Darius Cepulis Date: Tue, 27 Jan 2026 13:50:06 -0800 Subject: [PATCH] fix(site): style overflowing tables --- site/src/components/typography/Table.astro | 40 ++++++++++++++----- site/src/content/docs/how-to/write-guides.mdx | 9 ++++- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/site/src/components/typography/Table.astro b/site/src/components/typography/Table.astro index 7811f571..cfdcc3ca 100644 --- a/site/src/components/typography/Table.astro +++ b/site/src/components/typography/Table.astro @@ -1,17 +1,35 @@ --- +import type { HTMLTag, Polymorphic } from "astro/types"; +import { clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; -import type { HTMLTag, Polymorphic } from 'astro/types'; -import { clsx } from 'clsx'; -import { twMerge } from 'tailwind-merge'; - -type Props = Polymorphic<{ as: Tag }> & { - maxWidth?: boolean; - class?: string; +type Props = Polymorphic<{ as: Tag }> & { + maxWidth?: boolean; + class?: string; }; -const { as: Tag = 'table', maxWidth = true, class: className, ...props } = Astro.props; +const { + as: Tag = "table", + maxWidth = true, + class: className, + ...props +} = Astro.props; --- - - - +
+
+ + + + + +
+
diff --git a/site/src/content/docs/how-to/write-guides.mdx b/site/src/content/docs/how-to/write-guides.mdx index 7d72f6f5..69264200 100644 --- a/site/src/content/docs/how-to/write-guides.mdx +++ b/site/src/content/docs/how-to/write-guides.mdx @@ -149,6 +149,13 @@ The blockquote element represents content that is quoted from another source, op | --------- | -------- | ------ | | _italics_ | **bold** | `code` | +When a table is really wide, it overflows nicely on mobile + +| A | Table | With | A | Lot | Of | Columns | +| --- | --- | --- | --- | --- | --- | --- | +| contentcontentcontent | contentcontentcontent | contentcontentcontent | contentcontentcontent | contentcontentcontent | contentcontentcontent | contentcontentcontent | + + ### Code Blocks we can use 3 backticks ``` in new line and write snippet and close with 3 backticks on new line and to highlight language specific syntax, write one word of language name after first 3 backticks, for eg. html, javascript, css, markdown, typescript, txt, bash @@ -445,4 +452,4 @@ import ServerCode from '@/components/Code/ServerCode.astro'; -``` \ No newline at end of file +```