2013-05-08 19 views
0

enter image description here正確對準和表

你可以從我的兩個表見的大小,一個是不同尺寸的其他。 我的第一個問題是,這是爲什麼?當我將頂部表格中的<th>的寬度設置爲100/300/100/100/100(= 700),並且在底部表格中設置爲500/100/100(= 700)

  1. 我想將下表中的第一列設置爲不可見,因爲我只想查看底部表的總結和總計。我也希望與上表的右側對齊。任何想法或建議,將不勝感激。這是否與在樣式中設置邊界有關?

如果我嘗試邊界左邊例如我允許添加邊框寬度,邊框樣式,邊框顏色,繼承?

(表2)

<table class="detailstable StartOnNewPage" align="center"> 
     <tr>   

       <th style="width:500px;"></th> 
       <th style="text-align:left; width:100px;">Summary</th> 
       <th style="text-align:right; width:100px;"></th>   
     </tr> 
     <tr>     
       <td style="width:500px;"></td> 
       <td style="text-align:left; width:100px;">Labour</td> 
       <th style="text-align:right; width:100px;"><%: this.FormatMoney(LabourTotal)%></th> 
     </tr> 
     <tr>    
       <td style="width:500px;"></td> 
       <td style="text-align:left; width:100px; border-top:yes;">Plant</td> 
       <th style="text-align:right; width:100px;"><%: this.FormatMoney(PlantTotal)%></th>     
     </tr> 
     <tr> 
       <td style="width:500px;"></td>      
       <th style="text-align:right; width:100px;"><%: this.DisplayPlantPercentage%></th>  
       <td style="text-align:right; width:100px;"><%: this.PlantToDisplayWithTwoDecimalPlaces%></td> 
     </tr> 
     <tr>     
       <td style="width:500px;"></td> 
       <td style="text-align:left; width:100px;">Miscellaneous</td> 
       <th style="text-align:right; width:100px" class="FadeOutOnEdit"><%: this.FormatMoney(MiscellaneousItemsTotal) %></th>     
     </tr> 
     <tr> 
       <td style="width:500px;"></td>      
       <th style="text-align:right; width:100px;"><%: this.DisplayMiscellaneousPercentage%></th>  
       <td style="text-align:right; width:100px;"><%: this.MiscellaneousToDisplayWithTwoDecimalPlaces%></td> 
     </tr> 
     <tr> 
       <td style="width:500px;"></td> 
       <th style="text-align:left; width:100px;">TOTAL</th> 
       <th style="text-align:right; width:100px;"><%: this.FormatMoney(TotalOfAll)%></th>     
     </tr> 
     </table> 

現在看起來像: enter image description here

+0

Did你在這裏粘貼正確的表格? – Ravia 2013-05-08 09:12:30

+0

是的,這是我的底部表 – John 2013-05-08 09:14:00

+0

代碼嘗試兩個表的表寬度屬性= 700px。 – 2013-05-08 09:14:58

回答

0

對於較低的表中刪除的第一列並使用表屬性對齊如下所示

<table class="detailstable StartOnNewPage" align="right"> 
    <tr>   
    <th style="text-align:left; width:100px;">Summary</th> 
      <th style="text-align:right; width:100px;"></th>   
    </tr> 
    <tr>     
      <td style="text-align:left; width:100px;">Labour</td> 
      <th style="text-align:right; width:100px;"><%: this.FormatMoney(LabourTotal)%></th> 
    </tr> 

。 ...

+1

感謝解決它的人,請參閱我的編輯一個額外的概率 – John 2013-05-08 09:18:35

+0

它解決了嗎? – Ravia 2013-05-08 09:21:34

+0

是的,第一列現在是隱形的,但我仍然有一個垂直對齊的問題,請在原始帖子的「編輯」中看到新圖片 – John 2013-05-08 09:22:43