I have two tables with the same column spans and n...
# advancedpdf
l
I have two tables with the same column spans and no. of columns. Not all columns are populated though in the second table. But the columns don't align even if they have the same no. Of columns. The only difference is that some columns are blank in the second table. The code is in the reply section.
Copy code
<#if record.apply?has_content>

<table class="itemtable" style="margin-top: 10px; margin-left: 30px; margin-right: 30px; width: 100%;"><!-- start apply --><#list record.apply as apply><#if apply_index==0><tr class="apply-header gray-bg">
	<th align="center" colspan="3"><span style="font-size:11px;">Supplier Invoice</span></th>
	<th align="left" colspan="2"><span style="font-size:11px;">Date Issued</span></th>
	<th align="left" colspan="2"><span style="font-size:11px;">Currency&nbsp;</span></th>
	<th align="left" colspan="3"><span style="font-size:11px;">Invoice Amount</span></th>
	<th align="left" colspan="2"><span style="font-size:11px;">Discount</span></th>
	<th align="left" colspan="3"><span style="font-size:11px;">${apply.due@label}</span></th>
	<th align="left" colspan="3"><span style="font-size:11px;">${apply.amount@label}</span></th>
	</tr>
	</#if>
	<tr>
	<td align="center" colspan="3"><span style="font-size:11px;">${apply.refnum}</span></td>
	<td align="left" colspan="2"><span style="font-size:11px;">${apply.applydate}</span></td>
	<td align="left" colspan="2"><span style="font-size:11px;">${apply.currency}</span></td>
	<td align="left" colspan="3"><span style="font-size:11px;">${apply.amount}</span></td>
	<td align="left" colspan="2"><span style="font-size:11px;">${apply.disc}</span></td>
	<td align="left" colspan="3"><span style="font-size:11px;">${apply.due}</span></td>
	<td align="left" colspan="3"><span style="font-size:11px;">${apply.total}</span></td>
	</tr>
	</#list><!-- end apply --></table>

<hr /></#if><#if record.credit?has_content>

<table class="itemtable" style="margin-top: 10px; margin-left: 30px; margin-right: 30px; width: 100%;"><!-- start apply --><#list record.credit as credit><#if credit_index==0><tr class="apply-header gray-bg">
	<th align="center" colspan="3"><span style="font-size:11px;">Supplier Credit</span></th>
	<th align="left" colspan="2"><span style="font-size:11px;">Date Issued</span></th>
	<th align="left" colspan="2"><span style="font-size:11px;">Currency&nbsp;</span></th>
	<th align="left" colspan="3"><span style="font-size:11px;"></span></th>
	<th align="left" colspan="2"><span style="font-size:11px;"></span></th>
	<th align="left" colspan="3"><span style="font-size:11px;"></span></th>
	<th align="left" colspan="3"><span style="font-size:11px;">Applied</span></th>
	</tr>
	</#if>
	<tr>
	<td align="center" colspan="3"><span style="font-size:11px;">${credit.refnum}</span></td>
	<td align="left" colspan="2"><span style="font-size:11px;">${credit.creditdate}</span></td>
	<td align="left" colspan="2"><span style="font-size:11px;">${credit.currency}</span></td>
	<td align="left" colspan="3"><span style="font-size:11px;"></span></td>
	<td align="left" colspan="2"><span style="font-size:11px;"></span></td>
	<td align="left" colspan="3"><span style="font-size:11px;"></span></td>
	<td align="left" colspan="3"><span style="font-size:11px;">${credit.amount}</span></td>
	</tr>
	</#list><!-- end apply --></table>


</#if>
Tables by default auto-size to the contents. If you want two tables to have the same column widths, you can change the layout to fixed and specify widths for each column
l
Thanks, @michoel!