Skip to content

Wrong width of <TD> when using border-collapse and a <div> element #73

@stollr

Description

@stollr

Hi.
I have found a bug, when having a table with border-collapse: collapse and there is a

element in one of the cells.
You can reproduce the issue with this snippet:

<style type="text/css">
    table {border-collapse: collapse;}
    .table-bordered {border-width: 0.25mm; border-style: solid; border-color: #aaaaaa;}
</style>
<page backtop="5mm" backbottom="5mm" backleft="5mm" backright="5mm">
    <table>
        <tr>
            <th class="table-bordered" style="width: 20mm;">0 0</th>
            <th class="table-bordered" style="width: 21mm;">0 1</th>
            <th class="table-bordered" style="width: 22mm;">0 2</th>
        </tr>
        <tr>
            <td class="table-bordered"><div>1 0</div></td>
            <td class="table-bordered">1 1</td>
            <td class="table-bordered">1 2</td>
        </tr>
    </table>
</page>

The result of this code looks like this:
with-collapse
The first column is stretched over the whole page, because of the <div>element in the table cell.
But if you remove the table {border-collapse: collapse;} the table is rendered correctly. See:
without-collapse

I tried to debug the code and find out why this happens. But I was unsuccessful. So I hope you are more successful and can fix the issue @spipu ;-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions