How to Fix Table Cell Alignment Justification Anomaly

Here is the typical HTML code used for structuring the <td> cells of the table.


<td align="center" colspan="2">${record.duedate}</td>
<td align="center" colspan="2">${record.terms}</td>
<td align="center" colspan="2">${record.otherrefnum}</td>

White spaces are appeared between the letters of the words.

Here is the modified HTML code. The last line shows the fix for the unexpected cell alignment in the “PO #” column.

<td align="center" colspan="2">${record.duedate}</td>
<td align="center" colspan="2">${record.terms}</td>
<td align="center" colspan="2"><p style="text-align: center;">${record.otherrefnum}</p></td>

This simply wrap the cell contents inside of a <p> tag. Then add the proper style declaration “style=” with the desired text alignment parameter “text-align: center;” or whatever other text alignment we want.

Leave a comment

Your email address will not be published. Required fields are marked *