2012-02-14 5 views
0

テーブルのスクロール可能なヘッダーが必要です。だから私は、スタイルに固定された位置を使うことに決めました。問題は、Firefox & Chromeで幅が縮小されていることです。 Mozillaではうまく動作します。あなたの参照のために私はHTMLテーブルコードを掲示しました。テーブルの行に固定位置を使用するとFirefoxの問題が発生する

<html> 
<head> 
</head> 
<body> 
    <table width="150%"> 
     <thead> 
     <tr> 
      <th width="50%" align="left">Head 1</th> 
      <th width="50%" align="left">Head 2</th> 
     </tr> 
     </thead> 
     <tbody> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     <tr> 
      <td>Value 1</td> 
      <td>Value 2</td> 
     </tr> 
     </tbody> 
     <tfoot> 
     <tr><td>Foot 1</td></tr> 
     </tfoot> 
    </table> 

</body> 
</html> 

答えて

0

これはいかがですか?

<th align="left" style="position:fixed;float:left;">Head 1</th> 
<th align="left" style="position:fixed;float:right;left:75%;">Head 2</th> 
+0

私はこれを試しました。これを探していない、スクロールバーがテーブルのために来る。私はテーブルのスクロールを望んでいない、スクロールバーは、ページ全体のために来ると、テーブルのヘッダーは垂直だけでなく、水平スクロールする必要があります。 –

+0

注:私のテーブルの幅は100%ではない150%です –

+0

それは水平スクロールのために働いています。垂直スクロールでは機能しません。 –

関連する問題