Skip to content

Table padding styles fail for rowspans #364

Open
@hitsthings

Description

@hitsthings

What version of @tailwindcss/typography are you using?

0.5.12, also on main currently

What version of Node.js are you using?

20

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction repository

https://play.tailwindcss.com/N9NaJJTEfl

Describe your issue

These styles are meant for aligning the first and last column to the edge of the table:

'tbody td:first-child, tfoot td:first-child': {
  paddingInlineStart: '0',
},
'tbody td:last-child, tfoot td:last-child': {
  paddingInlineEnd: '0',
},

But they fail when faced with this markup:

<table>
   <tbody>
       <tr>
           <td rowspan="2">Spans two rows</td>
           <td>Single row</td>
           <td rowspan="2">Spans two rows</td>
       </tr>
       <tr>
           <td>Single row with bad padding</td>
       </tr>
   </tbody>
</table>

The cell in the second row has no inline padding, but is not at the edge of the table. It becomes misaligned from the rest of its column.

See the tailwind play reproduction.

Unfortunately, I don't have a solution except to remove these styles. Currently in the process of attempting to do that via tailwind theme overrides, but not achieved yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions