Hi,
Couple of small errors in the table code which can certainly make a difference, commented below. Also, you have 4 cells in the main middle row, but only 3 on the 1st and last rows. I added a column - if that's incorrect simply remove the extra 10 pix wide column from the middle row.
Note: The biggest problem with slow loading tables is that the browser needs to figure out the entire length of the page before it can print to the screen. (You'll notice as your page is loading that your scrollbars aren't getting shorter and adjusting dynamically.)
So it needs to add up all the heights of the images, tr's, td's, etc. before it can load, and it can't do this until it has all the data in the first place. There's a couple ways to speed the process up a bit:
1. If you have any tables at the "bottom" of a long list of rows, try to make it a separate table completely. That way the browser can print the bottom of the page at the same time as the top.
2. Get rid of as many extra spaces in the code as you can. For most long pages, having the entire code in a few very long lines can reduce load time by as much as 15%. Remember, the visual layout that most of us use - i.e.; indenting table data to make it easier to read, is for our benefit only. The browser would be happier if it was just one long line. If it's server generated, give it a shot. (It also makes it more difficult to others to reuse the code as they have to manually insert all the line breaks!!)
Here's the new code:
<html>
<body>
<div>
<table border="1" width="100%" cellspacing="0" cellpadding="0">
<tr valign="top">
<!--DELETE - You've got two in a row
<tr valign="top">
-->
<td width="10" class="header-light"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
<td width="10"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
<td width="100%"><p id="errorMessageField"></p
<!--ADD -->
<td width="10"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
</tr>
<!--ADD You're missing an opening tr tag-->
<tr valign="top">
<td width="10" class="header-light"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
<td width="10"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
<td width="100%" valign="top"><br>
<FORM NAME="ASSIGNMENT" METHOD="POST" ACTION="_ASSIGNMENT_">
<INPUT type="hidden" name="main" value="true"><INPUT type="hidden" name="op">
<div>
<table cellspacing="1" width="100%" cellpadding="4" border="1">
<tr valign="middle">
<th class="detail">Group</th>
<th colspan="3" class="detail">column header</th>
</tr>
<tr valign="middle">
<th width="200"> </th>
<th>test 1</th>
<th>test 2</th>
<th>test 3</th>
</tr>
<tr valign="middle" align="center" class="general">
<td>A G 1</td>
<td><a href=""><img height="18" width="25" alt="" border="0" name="__ASSIGNMENT_Default
<td><a href=""><img height="18" width="25" alt="" border="0" name="__ASSIGNMENT_HGFIag1
<td><a href=""><img height="18" width="25" alt="" border="0" name="__ASSIGNMENT_60j4ER1
</tr>
<tr valign="middle" align="center" class="general">
<td>A G 2</td>
<td><a href=""><img height="18" width="25" alt="" border="0" name="__ASSIGNMENT_Default
<td><a href=""><img height="18" width="25" alt="" border="0" name="__ASSIGNMENT_HGFIag1
<td><a href=""><img height="18" width="25" alt="" border="0" name="__ASSIGNMENT_60j4ER1
</tr>
</table>
<p><INPUT type="checkbox" name="s_change">change</p>
</div>
</FORM>
</td>
<!-- HERE'S THE EXTRA COLUMN IN THE MIDDLE ROW-->
<td width="10"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
</tr>
<tr valign="top">
<td width="10" class="header-light"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
<td width="10"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
<td width="100%"> </td>
<!--ADD -->
<td width="10"><img src="blank.gif" width="10" height="1" border="0" alt=""></td>
</tr>
</table>
</div>
<SCRIPT language="JavaScript">
<!--
var inputs = [document.ASSIGNMENT.__ASS
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
var images = [document.ASSIGNMENT.__ASS
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
document.ASSIGNMENT.__ASSI
-->
</SCRIPT>
</body>
</html>
Thanks
Main Topics
Browse All Topics





by: COBOLdinosaurPosted on 2003-07-24 at 15:52:07ID: 8999721
The table is not that complex and the graphics do not look that big. I would say the serverlet is inefficient, and that is where you need to look for improvment.
Cd&