Skip to content

Commit 77e3102

Browse files
committed
fix: add styling of tables to examples pages
1 parent f3a3b7c commit 77e3102

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/templates/examples.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,34 @@ const MarkdownOverrides = {
5151
</a>
5252
),
5353
},
54+
table: {
55+
component: ({ children }: PropsWithChildren) => (
56+
<div className="overflow-x-auto mb-2">
57+
<table className="border-0 border-collapse mb-1 border-spacing-0 ui-text-p2 text-left">{children}</table>
58+
</div>
59+
),
60+
},
61+
thead: {
62+
component: ({ children }: PropsWithChildren) => <thead className="bg-gray-50 border-b">{children}</thead>,
63+
},
64+
tbody: {
65+
component: ({ children }: PropsWithChildren) => <tbody className="border-b divide-neutral-300">{children}</tbody>,
66+
},
67+
tr: {
68+
component: ({ children }: PropsWithChildren) => (
69+
<tr className="hover:bg-gray-50 border-b divide-neutral-300">{children}</tr>
70+
),
71+
},
72+
th: {
73+
component: ({ children }: PropsWithChildren) => (
74+
<th className="px-3 py-2 text-left ui-text-p1 font-bold text-neutral-1100 tracking-wider whitespace-nowrap">
75+
{children}
76+
</th>
77+
),
78+
},
79+
td: {
80+
component: ({ children }: PropsWithChildren) => <td className="px-3 py-4 align-text-top text-sm">{children}</td>,
81+
},
5482
};
5583

5684
const Examples = ({ pageContext }: { pageContext: { example: ExampleWithContent } }) => {

0 commit comments

Comments
 (0)