Skip to content

markdown_preview: Apply few appearance tweaks for tables - #39190

Merged
danilo-leal merged 2 commits into
zed-industries:mainfrom
Simek:@simek/markdown-preview-table-appearance-tweaks
Oct 21, 2025
Merged

markdown_preview: Apply few appearance tweaks for tables#39190
danilo-leal merged 2 commits into
zed-industries:mainfrom
Simek:@simek/markdown-preview-table-appearance-tweaks

Conversation

@Simek

@Simek Simek commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

Why

Refs:

How

Apply suggested appearance changes in the comment mentioned above. I have also retained the different background for header rows, since it feels to me that it is something that GitHub styling lacks.

I have also attempted to shrink the table table element, to fit the content width (so it does not span for the full width of preview), but I have failed on those attempts. Tried to use many various GPUI attributes, but only thing that worked was setting the exact width on table container, also tried to reuse max_lengths values, but those are counting characters, not the rendered width. I would like to explore this a bit more, and try to follow up on those changes in a separate PR.

Release Notes:

  • Improved table elements styling in Markdown Preview

Preview

Screenshot 2025-09-30 at 12 04 30 Screenshot 2025-09-30 at 12 04 23 Screenshot 2025-09-30 at 12 04 15 Screenshot 2025-09-30 at 12 04 42 Screenshot 2025-09-30 at 12 04 34

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Sep 30, 2025
@Angelk90

Angelk90 commented Sep 30, 2025

Copy link
Copy Markdown
Contributor

@Simek : Great work, just one aesthetic consideration that Gitub doesn't take: you could make the corners rounded on the table, possibly with a flag for those who don't want it.

In any case, even if you don't do it, great work.

Regarding problem #39152, some initial considerations need to be made. I believe it is best to address it separately.

@danilo-leal danilo-leal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I pushed a few small tweaks just left-aligning the header text. I know the centered design is GitHub's markdown table take, but just didn't feel right... subjective to some extent. Let's see how it feels!

@danilo-leal
danilo-leal enabled auto-merge (squash) October 21, 2025 00:07
@danilo-leal
danilo-leal merged commit a2c4281 into zed-industries:main Oct 21, 2025
21 checks passed
@Simek
Simek deleted the @simek/markdown-preview-table-appearance-tweaks branch October 21, 2025 07:48
@Simek

Simek commented Oct 21, 2025

Copy link
Copy Markdown
Contributor Author

This makes sense, I was not fully sure about the alignment, but went with original comment suggestion on mentioned PR. I guess ideally the header and column text alignment could be driven by GFM syntax:

jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…ies#39190)

# Why

Refs:
*
zed-industries#39101 (comment)

# How

Apply suggested appearance changes in the comment mentioned above. I
have also retained the different background for header rows, since it
feels to me that it is something that GitHub styling lacks.

I have also attempted to shrink the table table element, to fit the
content width (so it does not span for the full width of preview), but I
have failed on those attempts. Tried to use many various GPUI
attributes, but only thing that worked was setting the exact width on
table container, also tried to reuse `max_lengths` values, but those are
counting characters, not the rendered width. I would like to explore
this a bit more, and try to follow up on those changes in a separate PR.

Release Notes:

- Improved table elements styling in Markdown Preview

# Preview

<img width="1616" height="582" alt="Screenshot 2025-09-30 at 12 04 30"
src="https://github.com/user-attachments/assets/4f1517cb-9046-4e09-a1e1-5223421efb71"
/>
<img width="1616" height="582" alt="Screenshot 2025-09-30 at 12 04 23"
src="https://github.com/user-attachments/assets/61303160-2b62-4213-80fc-ee8432cdf1fa"
/>
<img width="1616" height="582" alt="Screenshot 2025-09-30 at 12 04 15"
src="https://github.com/user-attachments/assets/059a447e-574d-4545-870a-93f1c00b3bb8"
/>
<img width="1616" height="582" alt="Screenshot 2025-09-30 at 12 04 42"
src="https://github.com/user-attachments/assets/8e7c6f9b-672f-4943-aded-1b644d2ff750"
/>
<img width="1616" height="582" alt="Screenshot 2025-09-30 at 12 04 34"
src="https://github.com/user-attachments/assets/6d31f7f3-d0ea-4987-bf8c-78f6b307a2b3"
/>

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants