# markdown: Add support for \`colspan\` and \`rowspan\` for HTML tables \(\#39898\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d5580050582a91bd2af9f7c4355c6a5b917bfa99

Requested commit: d5580050582a91bd2af9f7c4355c6a5b917bfa99

Commit: d5580050582a91bd2af9f7c4355c6a5b917bfa99

Tree: 1097f0cab1aa7f3673448aef4b5e56a4a2ead79f

Author: Remco Smits

Committer: GitHub

## Message

````
markdown: Add support for `colspan` and `rowspan` for HTML tables (#39898)

Closes https://github.com/zed-industries/zed/issues/39837

This PR adds support for `colspan` feature that is only supported for
HTML tables. I also fixed an edge case where the right side border was
not applied because it didn't match the total column count.

**Before**
<img width="725" height="179"
alt="499166907-385cc787-fc89-4e6d-bf06-c72c3c0bd775"
src="https://github.com/user-attachments/assets/69586053-9893-4c92-aa89-7830d2bc7a6d"
/>

**After**
<img width="1165" height="180" alt="Screenshot 2025-10-21 at 22 51 55"
src="https://github.com/user-attachments/assets/f40686e7-d95b-45a6-be42-e226e2f77483"
/>

```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>
    </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>
```

**TODO**:
- [x] Add tests for rending logic
- [x] Test all the tables again

cc @bennetbo

Release Notes:

- Markdown: Added support for `colspan` and `rowspan` for HTML tables

---------

Co-authored-by: Zed AI <ai@zed.nl>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
````

## Parents

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

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