Skip to content

Commit 6058003

Browse files
t3dotggclaude
andcommitted
fix(web): markdown table cells line up with surrounding text
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent dca46e2 commit 6058003

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎apps/web/src/components/chat/MarkdownTable.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export function MarkdownTable({ children, ...props }: ComponentProps<"table">) {
114114
{children}
115115
</table>
116116
</ScrollArea>
117-
<div className="mt-0.5 flex items-center justify-between select-none">
117+
{/* Pulls the icon buttons' padding out so the glyphs line up with the cell text. */}
118+
<div className="mt-0.5 -mx-1.5 flex items-center justify-between select-none">
118119
{hasClippedCells ? (
119120
<Tooltip>
120121
<TooltipTrigger

‎apps/web/src/index.css‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,10 +2135,21 @@ code {
21352135
font-size: 0.75rem;
21362136
}
21372137

2138+
/* Top-aligned so wrapped rows share a first line, and the outer columns sit
2139+
flush with the surrounding prose. */
21382140
.chat-markdown th,
21392141
.chat-markdown td {
21402142
padding: 0.45rem 0.75rem;
21412143
text-align: start;
2144+
vertical-align: top;
2145+
}
2146+
2147+
.chat-markdown :is(th, td):first-child {
2148+
padding-inline-start: 0;
2149+
}
2150+
2151+
.chat-markdown :is(th, td):last-child {
2152+
padding-inline-end: 0;
21422153
}
21432154

21442155
.chat-markdown thead th {

0 commit comments

Comments
 (0)