<!-- You can add line-height in td, and span -->
<!-- Change text color directly in span -->
<table style="font-size:7px;">
  <tr><td style="width: 100%; line-height: 50%;"></td></tr>
  <tr><td align="center"><span style="line-height: 250%; color: <?php use app\libraries\CommonHelper;

		  echo $THEME_COLOR_2; ?>;">正式收據 RECEIPT</span></td></tr>
</table>
<!-- LABELS --> 
<!-- 5 lines in total, 2 paddings, 2 wordings, 1 border bottom line -->
<table style="font-size:6px;">
  <tr><td colspan="5" style="width: 100%; line-height: 70%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"></td></tr>
  <tr>
    <td style="width: 40%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">項目</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">收費</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">數量</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">折扣</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">實價</span></td>
  </tr>
  <tr>
    <td style="width: 40%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">Item Description</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">Price</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">Quantity</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">Discount</span></td>
    <td style="width: 15%; line-height: 85%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"><span style="color: <?php echo $THEME_COLOR; ?>;">Total</span></td>
  </tr>
  <tr><td colspan="5" style="width: 100%; line-height: 60%;" align="center" bgcolor="<?php echo $THEME_THEAD_BGCOLOR; ?>"></td></tr>
  <tr><td colspan="5" style="width: 100%; line-height: 20%;" align="center"><table style="border-bottom: 1px solid <?php echo $THEME_THEAD_COLOR_BORDER_BOTTOM; ?>;"><tr><td align="center"></td></tr></table></td></tr>
	<!-- RECEIPT ITEMS -->
	<?php echo $_RECEIPT_ITEM_HTML; ?>

	<!-- TOTAL AMOUNT -->
	<tr><td colspan="5" style="width: 100%; line-height: 120%;"></td></tr>
	<tr>
		<td colspan="4" style="width: 84%; line-height: 80%;" align="right"><span style="color: <?php echo $THEME_COLOR; ?>;">已繳付款項 PAYMENT RECEIVED: </span></td>
		<td style="width: 16%; line-height: 80%;" align="center"><span style="line-height: 80%;"><?php echo $PAID_AMOUNT; ?></span></td>
	</tr>
	<tr>
		<td colspan="4" style="width: 84%; line-height: 80%;" align="right"><span style="color: <?php echo $THEME_COLOR; ?>;">總結欠 INVOICE　BALANCE : </span></td>
		<td style="width: 16%; line-height: 80%;" align="center"><span style="line-height: 80%;"><?php echo $INVOICE_BALANCE; ?></span></td>
	</tr>

</table>


<table style="font-size:6px;">
  <!-- Double line, each line will be illustrated by table border-bottom property-->
  <!-- Spaces between line can be adjusted by line-height -->
  <tr><td colspan="2" style="width: 100%; line-height: 5%;" align="center"></td></tr>
  <tr>
    <td style="width: 84%; line-height: 15%;"></td>
    <td style="width: 16%; line-height: 15%;"><table style="border-bottom: 1px solid <?php echo $THEME_THEAD_COLOR_BORDER_BOTTOM; ?>;"><tr><td></td></tr></table></td>
  </tr>
</table>

<!-- PAYMENT ITEMS -->
<?php echo $_RECEIPT_PAYMENT_ITEM_HTML; ?>

<!-- NET AMOUNT PAYABLE -->
<table style="font-size:6px;">
	<tr><td colspan="2" style="width: 100%; line-height: 120%;"></td></tr>
	<tr>
		<td style="width: 84%; line-height: 80%;" align="right"><span style="color: <?php echo $THEME_COLOR; ?>;">尚欠款額 NET AMOUNT PAYABLE: </span></td>
		<td style="width: 16%; line-height: 80%;" align="center"><table>
				<tr><td style="" align="center"><span style="line-height: 80%;"><?php echo $NET_AMOUNT_PAYABLE; ?></span></td></tr>
				<tr><td style="line-height: 50%"></td></tr>
			</table>
		</td>
	</tr>
</table>

<!-- CREDIT -->
<table style="font-size:6px;">
  <tr><td style="width: 100%; line-height: 240%;"></td></tr>
	<tr>
		<td style="line-height: 100%;" align="left"><span>使用盈餘 Credit Used：     <?php echo $USE_CREDIT; ?></span></td>
	</tr>
  <tr>
    <td style="line-height: 100%;" align="left"><span>撥入盈餘 Credit Added：     <?php echo $ADD_CREDIT; ?></span></td>
  </tr>
  <?php if (!empty($PIC_NAME)) : ?>
  <tr>
    <td align="left"><span style="">出單職員 Staff： <?php echo $PIC_NAME; ?></span></td>
  </tr>
  <?php endif; ?>
</table>

<table style="font-size:6px;">
<tr>    
    <td align="right;"><span>中心主管簽署：</span></td>
    <td align="center">
        <table style="border-bottom: 1px solid <?php echo $THEME_THEAD_COLOR_BORDER_BOTTOM; ?>;"><tr><td style=""></td></tr></table>            
    </td>
  </tr>
  <tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr><tr><td colspan="2">&nbsp;</td></tr>
</table>

<!-- Remark -->
<?php if(!empty($REMARK)):?>
	<table style="font-size:6px;border-bottom: 1px solid <?php echo $THEME_ITEM_COLOR_BORDER_BOTTOM; ?>;">
		<tr>
			<td align="center" style="width: 100%; ">
				<span style="color: <?php echo $THEME_COLOR_2; ?>;">收據備註</span>
			</td>
		</tr>
		<tr><td align="justify" style="width:100%;"><?php echo $REMARK;?></td></tr>
	</table>
<?php endif;?>

<!-- TERMS AND CONDITIONS / DISCLAIMER -->
<?php if(!empty($TOC)):?>
<table>
  <tr>
    <td align="center" style="font-size:5px;width: 100%; ">
      <span style="color: <?php echo $THEME_COLOR_2; ?>;">收據條款 TERMS AND CONDITIONS OF RECEIPT</span>
    </td>
  </tr>
  <tr><td align="justify" style="width:100%;font-size:5px;"><?php echo $TOC;?></td></tr>
</table>
<?php endif;?>
