W3C recommendations notwithstanding (see
http://w3.org/TR/html401/appendix/no...l#notes-tables) I can't
seem to persuade either of the leading browsers to do true incremental
table loading. Neither responds to COL/COLGROUP tags.
I have a very large data table which is being generated in
J/ECMA/JavaScript dynamically. I want to give the user some top rows
while the bottom rows are still loading. Without true incremental
table rendering I am down to the idea of trying to flush the buffer
halfway down the table, but I can't seem to be able to do that. Except
for inserting a call to "alert" (see below) with every other approach
the browser waits for the whole thing to load...
Basically, I have something like this:
<table>
<thead> <!-- pre-draw the headers -->
<tr>
<th>Header One</th>
<th>Header Two</th>
</tr>
</thead>
<tbody id="myData"> <!-- an empty TBODY -->
</tbody>
</table>
<script>
// call a function to write 20 rows from a data array
// the function adds rows and cells to the TBODY
// using tbody.insertRow and tr.insertCell calls
drawTable("myDataArray", 0, 20);
// what do I put here, between the two (or more) calls
// to drawTable to make the browser flush? the only
// thing that seems to do the trick (but is unacceptable)
// is a message box, i.e.:
alert("draw more?");
// I need something that has the same effect, but requires
// no user interaction
//call the function again to add the rest of the data
drawTable("myDataFile", 21, 2000);
</script>
Any help much appreciated (both with my general problem of displaying
a big HTML table in a user-friendly manner and with my immediate
problem of forcing a flush partway down). Thank in advance!
George