Skip to content

Colspan in first row not handled when table heading is missing #198

Closed

Description

@sbrown61

Colspan is properly handled when there is a table header or one is inferred. But if there is not a table header and there is a colspan in the first row of the table, the empty header (and "---" separator row) ignore the colspan attribute.

This is handled properly:

<table>
<tr><th>Col1</th><th>Col2</th></tr>
<tr><td colspan=2>Data</td></tr>
<tr>...</tr>
</table>

This is not:

<table>
<tr><td colspan=2>Data</td></tr>
<tr>...</tr>
</table>

To fix, the convert_tr() function should be updated. The lines in the elif at the end of the function that say "len(cells)" should instead say "full_colspan" like they do in the if statement.

Activity

  1. chrispy-snps commented on Mar 4, 2025

    @chrispy-snps
    Collaborator

    @sbrown61 - thanks for identifying the problem and narrowing down to a root cause!

    Are you interested in creating a pull request with the fix? If not, I can do it.

  2. chrispy-snps commented on Mar 5, 2025

    @chrispy-snps
    Collaborator

    Fixed by #203. Thanks @sbrown61!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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