<style>

	#total{
        border-collapse: collapse;
    }
    #total td {
        border: 1px solid #000; 
    }
	
	#iniprint th {
		border-top: 1px solid #000;
		border-bottom: 1px solid #000;
	}

</style>

<?php $tdNoFormat = isset($tdNoFormat)?$tdNoFormat:array(); ?>

     <?php if (!empty($rptDataDetail)) { ?>
	<?php if(isset($headerLeft)): ?>
    <tr>
    	<td colspan="2">
        	<?php 
				echo "<p style='padding-left:10px; margin:0; font-size:11px; '>"
								. "<strong>".$headerLeft."</strong></p>"
			?>
        </td>
    </tr>
    <?php endif; ?>
    <tr>
    	<td>
        	<table id="total" cellpadding="0" cellspacing="0" width="40%">
                   
                    <thead>
                    	<tr>
                        	<td width="40%">&nbsp;&nbsp;&nbsp;<?php echo $this->lang->line('voterID') ?></td>
                            <td>&nbsp;&nbsp;&nbsp;<b><?php echo $memberNo; ?></b></td>
                        </tr>
                        <tr>
                        	<td width="40%">&nbsp;&nbsp;&nbsp;<?php echo $this->lang->line('entityName') ?></td>
                            <td>&nbsp;&nbsp;&nbsp;<b><?php echo $entityName; ?></b></td>
                        </tr>
                        <tr>
                        	<td width="40%">&nbsp;&nbsp;&nbsp;<?php echo $this->lang->line('companyName') ?></td>
                            <td>&nbsp;&nbsp;&nbsp;<b><?php echo $companyName; ?></b></td>
                        </tr>
                    </thead>
                </table><br />
        </td>
    </tr>
    <tr>
       <td colspan="2" style="position: relative;">
                
                <table class="table" style="z-index: 100" cellpadding="0" cellspacing="0" width="80%">
                    <!--<thead class="thPrint">-->
                    <thead>
                        <tr id="iniprint"> <?php /*style="background:url(<?php echo base_url() ?>img/rptPaymentAdvice.png)" */ ?>
                            <?php 
                                if (isset($tableHeader)){
                                    
                                 if (!in_array("#",$tableHeader))
                                     echo " <th>No.</th>"; 
									 $p = 0;
								foreach ($tableHeader as $value) {
                                	if (isset($tdAmount) && in_array($selectFields[$p++],$tdAmount)) {	
										echo " <th style='text-align:right;'>".$value."</th>";
									}else{
										echo " <th>".$value."</th>";
									}
								}
                            }
                            ?>

                        </tr>
                    </thead>
                    <tbody class="tbPrint">
                    	<?php
						
                        $i = 1;
						$count = 1;
						
                        if(!empty($rptDataDetail)){
                        	foreach ($rptDataDetail as $row1) {
                          		
                            	echo "<tr>";
								echo "<td>".$i++."</td>";
								if($row1->elected > 1){
									echo "<td>".$row1->positionName." ".$count."</td>";
									$count++;
								}
								else{
									$count = 1;
									echo "<td>".$row1->positionName."</td>";
								}
								echo "<td>".$row1->candidateName."</td>";
								echo "</tr>";
								
								
								
							}
						}
                    ?>
                    	
                    
                        <?php 
                            if (isset($tableFooter)){
                                if (in_array("#",$tableHeader)) 
                                    echo " <tr><td style='text-align:right;' colspan='".sizeof($tableHeader)."'>";
                                else 
                                    echo " <tr><td style='text-align:right;' colspan='".(sizeof($tableHeader)+1)."'>";
                                
                                 foreach ($tableFooter as $value) {
                                    echo "<p>".$value."</p>";
                              }
                              echo "</td></tr>";
                            }
                        ?>
                </tbody>
            </table>       
      </td>
    </tr>
     <?php } ?>