Skip to content

Table width overflow #13419

Closed
Closed
@zhuozhiyongde

Description

@zhuozhiyongde

Astro Info

Astro                    v5.4.0
Node                     v18.20.4
System                   macOS (arm64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             unocss
                         astro-pure
                         output-copier

If this issue only occurs in one browser, which browser is a problem?

All

Describe the Bug

Due to the current compilation process converting markdown table syntax to table without additional wrapping, it is difficult to control its overflow behavior. In cases of width overflow, it causes the entire page to display a horizontal scrollbar.

Image

I tried the following methods, but none of them worked:

  1. Adding display: block; width: 100%; overflow-x: scroll to the table still causes it to expand.(Text no longer overflows, but thead and tbody will still implicitly expand the width.)

Image

  1. Add overflow-x: auto to the parent element of the table, the div that wraps all the markdown parsed content, which will cause the entire div to have a horizontal scrollbar.

What's the expected result?

When parsing markdown tables, add an extra layer of div.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-znw2yb4k?file=src%2Fcontent%2Fblog%2Ffirst-post.md

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageIssue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions