title: Scrollable table both horizontally and vertically with fixed header
body: <p>I am looking for scrollable table. It works fine when width is fixed but it doesn't works while columns are created dynamically.</p>
  
  <pre><code>&lt;table cellspacing="0" cellpadding="0" border="0" width="325"&gt;
    &lt;tr&gt;
      &lt;td&gt;
         &lt;table cellspacing="0" cellpadding="1" border="1" width="300" &gt;
           &lt;tr&gt;
              &lt;th&gt;col 1 heading&lt;/th&gt;
              &lt;th&gt;col 2 heading&lt;/th&gt;
           &lt;/tr&gt;
         &lt;/table&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;
         &lt;div style="width:325px; height:48px; overflow:auto;"&gt;
           &lt;table cellspacing="0" cellpadding="1" border="1" width="300" &gt;
             &lt;tr&gt;
               &lt;td&gt;col 1 data 1&lt;/td&gt;
               &lt;td&gt;col 2 data 1&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
               &lt;td&gt;col 1 data 2&lt;/td&gt;
               &lt;td&gt;col 2 data 2&lt;/td&gt;
             &lt;/tr&gt;
             &lt;tr&gt;
               &lt;td&gt;col 1 data 3&lt;/td&gt;
               &lt;td&gt;col 2 data 3&lt;/td&gt;
             &lt;/tr&gt;
           &lt;/table&gt;  
         &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>I found it from here <a href="http://www.scientificpsychic.com/blogentries/html-and-css-scrolling-table-with-fixed-heading.html" rel="nofollow noreferrer">http://www.scientificpsychic.com/blogentries/html-and-css-scrolling-table-with-fixed-heading.html</a></p>
  
  <p>See demo</p>
  
  <p><a href="http://jsfiddle.net/u8yyD/" rel="nofollow noreferrer">http://jsfiddle.net/u8yyD/</a></p>