title: HTML table with fixed headers and a fixed first column for the iPhone
body: <p>I'm working on a web app that's optimized for an iPhone.</p>
  
  <p>On one of the pages, I'll have a table with hundreds of rows, and dozens of columns.</p>
  
  <p>I'd like to have it work so that the first column is fixed (remains visible) as the user scrolls to the right, and the headers are fixed as the user scrolls down (i.e., like "freeze panes" in Excel).</p>
  
  <p>There's another post that addresses this EXACT question:</p>
  
  <p><a href="https://stackoverflow.com/questions/684211/html-table-with-fixed-headers-and-a-fixed-column">HTML table with fixed headers and a fixed column?</a></p>
  
  <p>... and presents an excellent solution:</p>
  
  <p><a href="http://fixed-header-using-jquery.blogspot.com/2009/05/scrollable-table-with-fixed-header-and.html" rel="nofollow noreferrer">http://fixed-header-using-jquery.blogspot.com/2009/05/scrollable-table-with-fixed-header-and.html</a></p>
  
  <p>... and a demo: <a href="http://acatalept.com/common/test/fixed-table.html" rel="nofollow noreferrer">http://acatalept.com/common/test/fixed-table.html</a></p>
  
  <p>However, this doesn't seem to work on an iPhone - the entire PAGE scrolls.</p>
  
  <p>How would I modify this example so that it works on the iPhone?</p>
  
  <p>(Fortunately, a solution ONLY needs to work on a iPhone, so I can take advantage of any specific webkit features, and ignore issues with other browsers. Of course, a cross-browser compliant solution is even better...)</p>
  
  <p>[UPDATE]</p>
  
  <p>OK, so I realized I was asking the wrong question.</p>
  
  <p>The issue, I believe, is that webkit for iPhone does not provide a native way to scroll content inside a fixed size (width/height) div. So basically it was impossible to have a fixed header/footer and a scrolling central area.</p>
  
  <p>(Galambalazs answer below is an excellent one, and works in any DESKTOP browser I tested, but not in the iPhone, since, instead of scrolling only the table body, it scrolls the entire page).</p>
  
  <p>Then, I came across Mateo Spinelli's iScroll (<a href="http://cubiq.org/iscroll" rel="nofollow noreferrer">http://cubiq.org/iscroll</a>). I haven't finished implementing the full solution I was looking for, but his script seems to handle the exact problem I was having.</p>
  
  <p>I can't comment yet on how well his code works, but his demos are absolutely terrific, so my hunch is that iScroll is going to be a great solution.</p>