# markdown: Fix HTML tables with mismatching columns \(\#41108\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/986ca19516e0b6b0b0a961e07f0f135a5292a827)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 986ca19516e0b6b0b0a961e07f0f135a5292a827

Requested commit: 986ca19516e0b6b0b0a961e07f0f135a5292a827

Commit: 986ca19516e0b6b0b0a961e07f0f135a5292a827

Tree: fbef2dfeee435399f356ae1340cc3e3f4ec93f0e

Author: Remco Smits

Committer: GitHub

## Message

````
markdown: Fix HTML tables with mismatching columns (#41108)

Follow-up: https://github.com/zed-industries/zed/pull/39898

Right now, we don't fill the empty column when the current row count is
less than the max row count. This PR fixes that by filling it with an
empty cell. So the table columns don't flow in the wrong direction, as
you can see inside the first screenshot.

**Before**
<img width="1095" height="182" alt="Screenshot 2025-10-24 at 16 09 02"
src="https://github.com/user-attachments/assets/e3abf24e-c190-4bd7-b43a-39f2f01ecd1c"
/>

**After**
<img width="1165" height="178" alt="Screenshot 2025-10-24 at 16 19 17"
src="https://github.com/user-attachments/assets/427c25f9-82a7-498b-a1a2-d71e4c288fe5"
/>

**Code example**
```html
<table>
    <tr>
        <th rowspan="2">Region</th>
        <th colspan="2">Revenue</th>
        <th rowspan="2">Growth</th>
    </tr>
    <tr>
        <th>Q2 2024</th>
        <th>Q3 2024</th>
    </tr>
    <tr>
        <td>North America</td>
        <td>$2.8M</td>
        <td>$2.4B</td>
        <td>+85,614%</td>
        <td>+99%</td> // extra column here
    </tr>
    <tr>
        <td>Europe</td>
        <td>$1.2M</td>
        <td>$1.9B</td>
        <td>+158,233%</td>
    </tr>
    <tr>
        <td>Asia-Pacific</td>
        <td>$0.5M</td>
        <td>$1.4B</td>
        <td>+279,900%</td>
    </tr>
</table>
```

**Note** there are no release notes, as the previous PR didn't get
released yet.

Release Notes:

- N/A
````

## Parents

- [42d8d77938a421b89da00adcf61cacfa6f73f45d](https://git.cafe/gitcafe/zed/commit/42d8d77938a421b89da00adcf61cacfa6f73f45d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/986ca19516e0b6b0b0a961e07f0f135a5292a827?format=markdown)
