Consider this crude (uses some deprecated elements; fails accessibility standards; other shortcomings) example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:/ +/www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>demo</title> <meta http-equiv="Content-Style-Type" content="text/css"> </head> <body> <table summary="your order"> <thead> <tr><th>Item</th> <th>Item #</th> <th>Shiping</th> <th>Unit Price</th> <th>Quantity</th> <th style="text-align:right;">Item Total</th> </tr> </thead> <tbody> <tr> <td>foo</td> <td>12345</td> <td>Post</td> <td>9.99</td> <td>10</td> <td style="text-align:right;">99.90</td> </tr> <tr> <td>bar</td> <td>123456</td> <td>Bicycle Messenger</td> <td>1.99</td><td>1000</td> <td style="text-align:right;">1999.00</td></tr> <tr><td>blivitz</td> <td>1234567</td> <td>Pony Express</td> <td>9.99</td><td>10</td> <td style="text-align:right;">9999.00</td> </tr> <tr><td colspan="6"> ...Many more rows with item totals of &lt; 10,000 +.00 .... </td></tr> <tr> <td colspan="5" style="text-align: right;">Order Total:</td><td style= +"text-align:right;">125,567,097.90</td></tr> </tbody> </table>

Before the rendering engine can calculate a proper width for the last column, it must know the maximum width needed (ie, 14 characters for the last col of the last row), which it cannot know until all <table> (or, at least, all <tbody> in this case) has been received.

Were it to start after receipt of the first <tbody> row, the width it allocated would be inadequate for the last cell in the row containing "Order Total:" and it would therefore have to re-render the rows above. It could, of course, be engineered to do it that way, but the consequence would be additional load on the processor and screen jitter for the viewer... which is why browsers (well, those with which I have any familiarity) do not render tables until they have width info, whether from complete receipt of the table or width info from the tags, as, for an even cruder example:

<table width="90%" summary="Using widths (should use css these days)"> <tr> <td width="10%">something</td> <td width="50%">something longer</td> <td width="40%">middlin' long</td> </tr> </table> </body> </html>

The second example allows the rendering engine to assign/allocate appropriate widths without waiting for all data.


In reply to Re^4: CGI Question - Tangent re rendering engine by ww
in thread CGI Question by njweatherman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.