Click to See Complete Forum and Search --> : JSP Html Table Annoyance


bud1664
April 23rd, 2004, 08:07 AM
Need help solving a Html Table Layout problem. I've setup the layout how I want to see the page, but now include the JSP:include statements & the layout now is mucked up.

Webserver Tomcat, browser testing Mozilla 1.6 & IE 6.

Can anyone help??? :confused: ???

Non JSP Version (Works) :
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100">Cell 1</td>
<td>Main Cell</td>
</tr>
<tr>
<td colspan="2">Bottom Cell</td>
</tr>
</table>

JSP Version (Doesn't look how I want) :
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100">Cell 1</td>
<td>Main Cell</td>
</tr>
<tr>
<td colspan="2"><jsp:include page="includeJSP.jsp"><jsp : param name="paramName" value="paramValue"></jsp : param></jsp:include></td>
</tr>
</table>

khp
April 23rd, 2004, 09:28 PM
What do you get when you view the jsp page in a browser ?, particuarly what do you get when you select view->'page source' in the browser ? (that way you see the html code generated by the jsp page).

What do you get when you view the page 'includeJSP.jsp' directly in a browser ?

bud1664
April 24th, 2004, 01:25 AM
The html thats the browser receives is that i'm expecting it to be.

HTML Extract should have read like this in previous post :
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100"><jsp:include page="includeJSP.jsp"><jsp : param name="paramName" value="paramValue"></jsp : param></jsp:include></td>
<td>Main Cell</td>
</tr>
<tr>
<td colspan="2">Cell 2</td>
</tr>
</table>

"includeJSP.jsp" displays fine if its viewed directly, its the main jsp page which doesn't want to obay they width value in the td tag.

Is this just an IE annoyance which i'll have to live with? Mozilla displays what I want it to, just IE doesn't

bud1664
April 24th, 2004, 01:08 PM
I've narrowed down the problem after rewriting the html pages from scratch.

With Footer.jsp (1) the layout is fine, as change it to Footer.jsp (2) then the layout problems start, as soon as Footer.jsp Table uses row or col span.

Hope this helps ppl help me solve this problem.

Base Html Page:
<html>
<body>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="2"><table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td bgcolor="#FFFFFF" height="25" width="25">TL</td>
<td bgcolor="#FFFFFF" align="center">Center</td>
<td bgcolor="#FFFFFF" height="25" width="25">TL</td>
</tr>
</table></td>
</tr>
<tr>
<td width="100"><jsp:include flush="true" page="navbar.jsp"></jsp:include></td>
<td>Main</td>
</tr>
<tr>
<td colspan="2">Spacing</td>
</tr>
<tr>
<td colspan="2"><jsp:include flush="true" page="footer.jsp"></jsp:include></td>
</tr>
</table>
</body>
</html>

Navbar.jsp:
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr><td>Cell 1</td></tr>
<tr><td>Cell 2</td></tr>
<tr><td>Cell 3</td></tr>
<tr><td>Cell 4</td></tr>
<tr><td>Cell 5</td></tr>
</table>

Footer.jsp (1):
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>Cell 1aa</td>
<td>Cell 1ba</td>
<td>Cell 1ca</td>
</tr>
<tr>
<td>Cell 1ab</td>
<td>Cell 1bb</td>
<td>Cell 1cb</td>
</tr>
<tr>
<td>Cell 1ac</td>
<td>Cell 1bc</td>
<td>Cell 1cc</td>
</tr>
</table>

Footer.jsp (2):
<table border="1" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td rowspan="3">Cell 1a</td>
<td rowspan="3">Cell 1b</td>
<td>Cell 1ca</td>
</tr>
<tr>
<td>Cell 1cb</td>
</tr>
<tr>
<td>Cell 1cc</td>
</tr>
</table>