2015-07-11 76 views
0

我可以知道在我的表格中,如何在支付ID和更新付款列之间添加一列,但无法调试?我的代码如下。 注意:由于我没有足够的声望,我无法发布图片。HTML表格中的额外列

<td width="52">Bookng id</td>  
    <td width="78">Deposit</td> 
    <td width="149">Total_amt_paid</td> 
    <td width="149">Balance</td> 
    <td width="149">Payment status</td> 
    <td width="57">Card type</td> 
    <td width="62">Total price</td> 
    <td width="94">Payment id</td> 
    <td width="62"></td> 
    <td width="293">Update Payment</td> 
    </tr> 
    <?php do { ?> 
    <tr> 
    <th height="45"><?php echo $row_RecordsetUpdatePayment['Booking_id']; ?></th> 

    <th><?php echo $row_RecordsetUpdatePayment['Deposit']; ?></th> 
    <th><?php echo $row_RecordsetUpdatePayment['Total_amt_paid']; ?></th> 
    <th><?php echo $row_RecordsetUpdatePayment['Balance']; ?></th> 
    <th><?php echo $row_RecordsetUpdatePayment['Payment_status']; ?></th> 
    <th><?php echo $row_RecordsetUpdatePayment['Card_type']; ?></th> 
    <th><?php echo $row_RecordsetUpdatePayment['Total_price']; ?></th> 
    <th><?php echo $row_RecordsetUpdatePayment['Payment_id']; ?></th> 
    <th><?php if($row_RecordsetUpdatePayment['Payment_status'] == 'Fully Paid'){ 
       echo "<th><span style='color:grey' href='UpdatePayment.php?Payment_id=".$row_RecordsetUpdatePayment['Payment_id']."'> Update</span></th>"; } 
       if($row_RecordsetUpdatePayment['Payment_status'] == 'Partial'){ 
       echo "<th><a href='UpdatePayment.php?Payment_id=".$row_RecordsetUpdatePayment['Payment_id']."'> Update</a></th>"; 
       } 
       ?> 
      </th> 
+0

您在第一个tr中有一个额外的列()。这是你指的是什么? – Mindastic

+0

嗨,如果我没有把额外的列,“更新付款”文本列将进入空白列,我的“更新”链接列将进入第二列,留下标题空白。它会变成2个分隔的列而不是一个列 –

回答

0

从你的标题行删除多余的<td>

<tr> 
    <td width="52">Bookng id</td>  
    <td width="78">Deposit</td> 
    <td width="149">Total_amt_paid</td> 
    <td width="149">Balance</td> 
    <td width="149">Payment status</td> 
    <td width="57">Card type</td> 
    <td width="62">Total price</td> 
    <td width="94">Payment id</td> 
    <td width="293">Update Payment</td> 
</tr> 
+0

嗨,如果我没有把额外的列,“更新付款”文本列将进入空白列,我的“更新”链接列将进入第二列留下标题空白。它会变成2个分隔的列而不是一个列 –

+0

您是否想要有两列,因此您可以扫描一列满并且另一列用于部分?或者你是否想要有一列可以是全部或部分? –

1

我看到你的代码的两个问题:

首先,你应该得到的第一行中摆脱你的空

<tr> 
    <td width="52">Bookng id</td>  
    <td width="78">Deposit</td> 
    <td width="149">Total_amt_paid</td> 
    <td width="149">Balance</td> 
    <td width="149">Payment status</td> 
    <td width="57">Card type</td> 
    <td width="62">Total price</td> 
    <td width="94">Payment id</td> 
    <td width="293">Update Payment</td> 
</tr> 

其次,您打开<th>标签并检查ac ondition内并打开状态中一个新的<th>标签,所以你的代码应该是这样的:

<th><?php echo $row_RecordsetUpdatePayment['Deposit']; ?></th> 
<th><?php echo $row_RecordsetUpdatePayment['Total_amt_paid']; ?></th> 
<th><?php echo $row_RecordsetUpdatePayment['Balance']; ?></th> 
<th><?php echo $row_RecordsetUpdatePayment['Payment_status']; ?></th> 
<th><?php echo $row_RecordsetUpdatePayment['Card_type']; ?></th> 
<th><?php echo $row_RecordsetUpdatePayment['Total_price']; ?></th> 
<th><?php echo $row_RecordsetUpdatePayment['Payment_id']; ?></th> 
<?php if($row_RecordsetUpdatePayment['Payment_status'] == 'Fully Paid') { 
    echo "<th><span style='color:grey' href='UpdatePayment.php?Payment_id=".$row_RecordsetUpdatePayment['Payment_id']."'> Update</span></th>"; 
} else { 
echo "<th><a href='UpdatePayment.php?Payment_id=".$row_RecordsetUpdatePayment['Payment_id']."'> Update</a></th>"; 
} ?> 

这应该是它。

+0

嗨,感谢Mindastic。有用!! –

+0

优秀。请考虑将这个答案标记为正确的,如果这真的帮助你解决你的问题。谢谢。 – Mindastic

+0

如何标记? –