Skip to content

Commit f5664c8

Browse files
committed
fix mdx table styling
1 parent e9b567b commit f5664c8

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

mdx-components.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ function MarkDownImage(props: any) {
3535

3636
export function useMDXComponents(components: MDXComponents): MDXComponents {
3737
return {
38+
table: (props) => (
39+
<table className="table-auto border-collapse border border-gray-300 w-full">
40+
{props.children}
41+
</table>
42+
),
43+
th: (props) => (
44+
<th className="border px-4 py-2 bg-gray-100 text-left">
45+
{props.children}
46+
</th>
47+
),
48+
td: (props) => (
49+
<td className="border px-4 py-2">
50+
{props.children}
51+
</td>
52+
),
3853
h1: ({ children }) => <h1 className="font-bold text-5xl text-center">{children}</h1>,
3954
h2: ({ children }) => <h2 className="font-bold text-3xl text-left">{children}</h2>,
4055
h3: ({ children }) => <h3 className="font-bold text-2xl text-left">{children}</h3>,

0 commit comments

Comments
 (0)