Skip to content

Commit d0c0ef1

Browse files
committed
Add table style - close velopert#41
1 parent cc657d2 commit d0c0ef1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/components/common/MarkdownRender.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import media from '../../lib/styles/media';
1313
import parse from 'html-react-parser';
1414
import { throttle } from 'throttle-debounce';
1515
import sanitize from 'sanitize-html';
16+
import palette from '../../lib/styles/palette';
1617

1718
export interface MarkdownRenderProps {
1819
markdown: string;
@@ -81,6 +82,35 @@ const MarkdownRenderBlock = styled.div`
8182
background: none;
8283
padding: none;
8384
}
85+
86+
table {
87+
min-width: 40%;
88+
max-width: 100%;
89+
border: 1px solid ${palette.gray7};
90+
border-collapse: collapse;
91+
font-size: 0.875rem;
92+
thead > tr > th {
93+
/* text-align: left; */
94+
border-bottom: 4px solid ${palette.gray7};
95+
}
96+
th,
97+
td {
98+
word-break: break-word;
99+
padding: 0.5rem;
100+
}
101+
102+
td + td,
103+
th + th {
104+
border-left: 1px solid ${palette.gray7};
105+
}
106+
107+
tr:nth-child(even) {
108+
background: ${palette.gray1};
109+
}
110+
tr:nth-child(odd) {
111+
background: white;
112+
}
113+
}
84114
`;
85115

86116
function filter(html: string) {

0 commit comments

Comments
 (0)