title: How to make sure an HTML table renders incrementally
body: <p>I have an old-style CGI program which generates a large HTML table.  Because the table contents are slow to calculate (even though it's not that big) I would like to print it one row at a time, and have the browser display rows as they are fetched.</p>
  
  <p>If you search online you'll see that style="table-layout: fixed" is supposed to help some browsers do this, but on the other hand Firefox can render incrementally even without it.  My test browser is Firefox 4.0b10 on Windows but I cannot get it to display incrementally using the simple example below:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;x&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;table width="100%" style="table-layout: fixed" rows="4" cols="4"&gt;
        &lt;col width="10%" /&gt;
        &lt;col width="20%" /&gt;
        &lt;col width="30%" /&gt;
        &lt;col width="40%" /&gt;
        &lt;tr&gt;&lt;td width="10%"&gt;a&lt;/td&gt;&lt;td width="20%"&gt;b&lt;/td&gt;&lt;td width="30%"&gt;c&lt;/td&gt;&lt;td width="40%"&gt;d&lt;/td&gt;&lt;/tr&gt;
        &lt;!-- flush output, one second pause... --&gt;
        &lt;tr&gt;&lt;td width="10%"&gt;a&lt;/td&gt;&lt;td width="20%"&gt;b&lt;/td&gt;&lt;td width="30%"&gt;c&lt;/td&gt;&lt;td width="40%"&gt;d&lt;/td&gt;&lt;/tr&gt;
        &lt;!-- flush output, one second pause... --&gt;
        &lt;tr&gt;&lt;td width="10%"&gt;a&lt;/td&gt;&lt;td width="20%"&gt;b&lt;/td&gt;&lt;td width="30%"&gt;c&lt;/td&gt;&lt;td width="40%"&gt;d&lt;/td&gt;&lt;/tr&gt;
        &lt;!-- flush output, one second pause... --&gt;
        &lt;tr&gt;&lt;td width="10%"&gt;a&lt;/td&gt;&lt;td width="20%"&gt;b&lt;/td&gt;&lt;td width="30%"&gt;c&lt;/td&gt;&lt;td width="40%"&gt;d&lt;/td&gt;&lt;/tr&gt;
        &lt;!-- flush output, one second pause... --&gt;
      &lt;/table&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Instead the page is blank until the end of the download, when the whole table appears.  I've tried various ways to tell the browser the table dimensions in advance so it should have no problem displaying it as it arrives, but they don't help.  (Removing the hints doesn't help either.)</p>
  
  <p>If I modify my CGI script to close and restart the table between each row, with an extra blank paragraph in between, then the page does render incrementally in the browser.  This shows that the data is getting to the browser incrementally - just Firefox is choosing not to render it.</p>
  
  <p>Ironically, much more complex scripts producing larger tables seem to do what I want, showing one row at a time as it downloads, but whenever I try to reduce the output to a minimal test case it doesn't work.  This leads me to suspect there is some complexity heuristic used by Firefox's rendering engine.</p>
  
  <p>What's the magic dust I need to tell the browser to always display the table as downloaded so far?</p>