Table td not resized correct when it contains a float img
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 11.2k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
When an image inside a td element has the float:xxx property set, the td is resized incorrectly, and the image is displayed behind other td-elements.
Minimal example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title></title>
</head>
<body>
<table border=1>
<tr>
<td><img style="float:right" src="https://placekitten.com/150/75"/></td>
<td>Some Text</td>
</tr>
<tr>
<td>More Text</td>
<td>Blah</td>
</tr>
</table>
</body>
</html>
This should be rendered exactly as the test/dom_table_image.html example, but is not.
This is what the browser (ff 31) shows:

This is the PDF output:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the minimal HTML example and comparing the PDF with test/dom_table_image.html, which the report identifies as the expected rendering. Trace the table and floated-image layout handling, then add or update a regression case so the table cell sizing and image placement match that example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, html, php
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100