2013-01-08 209 views
0

我創建了一個可滾動的gridview。所以我創建了一個表格,它是網格標題的副本。我給每個像素的寬度屬性。但它在不同的瀏覽器中有所不同。任何幫助讚賞。可滾動的GridView在不同的瀏覽器中

Here is the photo 這是網格標題的標記。

<table cellpadding="0" cellspacing="0"> 
      <tr> 
       <th width="26px"> 
       </th> 
       <th width="152px"> 
        Sosial sığorta nömrəsi 
       </th> 
       <th width="122px"> 
        Soyadı 
       </th> 
       <th width="121px"> 
        Adı 
       </th> 
       <th width="120px"> 
        Atasının adı 
       </th> 
       <th width="50px"> 
        Cinsi 
       </th> 
       <th width="100px"> 
        Doğum tarixi 
       </th> 
       <th width="122px"> 
        Uçota düşmə tarixi 
       </th> 
       <th width="102px"> 
        SUN (köhnə) 
       </th> 
       <th width="150px"> 
        Sığorta edənin VÖEN-i 
       </th> 
       <th width="102px"> 
        SUN 
       </th> 
       <th width="102px"> 
        Ölüm tarixi 
       </th> 
      </tr> 
     </table> 
+0

嘗試指定表格的寬度 – DON

回答

0

而不是創建兩個表,一個是頭,另一個用於數據 - 只需創建一個單一的表...

像這樣的東西應該有正確的寬度所有列:

<table cellpadding="0" cellspacing="0"> 
     <tr> 
      <th width="26px"> 
      </th> 
      <th width="152px"> 
       Sosial sığorta nömrəsi 
      </th> 
      ..... 
      <th width="102px"> 
       Ölüm tarixi 
      </th> 
     </tr> 
     <tr> <!-- Enter data here --> 
     </tr> 
     <tr> <!-- Enter data here --> 
     </tr> 
    </table> 
0

正如Blachshma說,你只能使用一個表,要解決列的寬度同樣爲所有的瀏覽器。我想,使表/格滾動是一件容易的事......

試試這個..

<div style="max-width:500px;overflow:auto;"> 

    // Here, HTML code for Table or Gridview 

</div> 

希望,它可以幫助你。 ! 謝謝。