PDF Table cell vertical align

  •  08-10-2007, 11:02 AM

    PDF Table cell vertical align

    When generating a PDF from the CuteEditor control, I've noticed a bit of a quirk in that text in table cells tends to become top aligned, leading to a large gap below the text, which is messing up my layout somewhat.

    This can be reproduced by pasting the following HTML into the PDF generation demo and viewing the generated PDF:
    <table border="1" bordercolor="black" cellpadding="0" cellspacing="0" width="500">
        <tbody>
            <tr>
                <td align="center"><strong>Test of table</strong></td>
                <td align="center"><strong>cell headers</strong></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
        </tbody>
    </table>
    <br />

    Is there any solution to this, either to make the height of the table cells smaller, or to vertically-align the text within them? (I've tried many HTML/CSS tweaks to fix this, but none have worked so far unfortunately). I suspect it's a limitation of the PDF spec., but I don't know much about the internal's of the PDF format, so I could be very wrong :).

    Thanks for any help,
    Simon.

    Filed under: ,
View Complete Thread