Hi all,
I have a problem with jsp. I created jsp and there is a table within this page. The columns are based on query from database. When the datas are not too many, the table looks fine. But when it has so many datas the table got messy. But what I don't understand, when I load the jsp in internet explorer, the table looks fine with same many datas.
Can anyone please help how to solve this?
This is a part of my codes:
<div style="overflow:auto;width:800px;">
<!-- BODY -->
<% int widthA = 65 * firstcode_count + 160; %>
<% if (widthA < 800) { widthA = 800; }%>
<% int len1 = 0; %>
<table width=<%= widthA %> border="0" cellpadding="0" cellspacing="0">
<tr class="featurecontentbold" align="right" bgcolor="#EDF395">
<th width=40><%= widthA %></th>
<th align="center" width=100>Time Range</th>
<% for (int i = 0; i < firstcode_count; i++) {
String firstCode = firstCodes.O_FIRST_SELECTION[i].trim(); %>
<th width=65><%= firstCode %></th><% } %>
<th width=20></th>
</tr>
<tr bgcolor="#CCCCCC" class="featurecontent">
<td colspan="<%= firstcode_count + 3 %>"><img src="../../images/line.gif" width="<%= widthA %>" height="3"></td>
</tr>
<% int idx = 0;
int[] totalTrans = new int[firstcode_count];
// initialize
for (int i = 0; i < firstcode_count; i++) { totalTrans[i] = 0; }
for (int i = 0; i < user_count; i++)
{
String timeRange = null;
switch (Integer.parseInt(list.O_TRANS_DATE[i]))
{
case 0: timeRange = "00:00 - 00:59"; break;
case 1: timeRange = "01:00 - 01:59"; break;
case 2: timeRange = "02:00 - 02:59"; break;
case 3: timeRange = "03:00 - 03:59"; break;
case 4: timeRange = "04:00 - 04:59"; break;
case 5: timeRange = "05:00 - 05:59"; break;
case 6: timeRange = "06:00 - 06:59"; break;
case 7: timeRange = "07:00 - 07:59"; break;
case 8: timeRange = "08:00 - 08:59"; break;
case 9: timeRange = "09:00 - 09:59"; break;
case 10: timeRange = "10:00 - 10:59"; break;
case 11: timeRange = "11:00 - 11:59"; break;
case 12: timeRange = "12:00 - 12:59"; break;
case 13: timeRange = "13:00 - 13:59"; break;
case 14: timeRange = "14:00 - 14:59"; break;
case 15: timeRange = "15:00 - 15:59"; break;
case 16: timeRange = "16:00 - 16:59"; break;
case 17: timeRange = "17:00 - 17:59"; break;
case 18: timeRange = "18:00 - 18:59"; break;
case 19: timeRange = "19:00 - 19:59"; break;
case 20: timeRange = "20:00 - 20:59"; break;
case 21: timeRange = "21:00 - 21:59"; break;
case 22: timeRange = "22:00 - 22:59"; break;
case 23: timeRange = "23:00 - 23:59"; break;
}
%><tr bgcolor="#F7FACC" align="right" class="featurecontent">
<td align="center"><%= ++idx %></td>
<td align="center"><%= timeRange %></td>
<% for (int j = 0; j < firstcode_count; j++)
{
int noOfTrans = 0;
if (i < user_count && list.O_FIRST_SELECTION[i].equals(firstCodes.O_FIRST_SELECTION[j]))
{
noOfTrans = list.O_TOT_TRANS[i].intValue();
totalTrans[j] += noOfTrans;
i++;
}
%>
<td>
<% len1 = nvl.toBlank(noOfTrans).length(); %>
<% if (len1 <= 3) { %> <%= nvl.toBlank(noOfTrans).substring(0,len1) %> <% } %>
<% if (len1 > 3 && len1 <=6) { %> <%= nvl.toBlank(noOfTrans).substring(0,len1 - 3) %>.<%= nvl.toBlank(noOfTrans).substring(len1 - 3,len1) %> <% } %>
<% if (len1 > 6 && len1 <=9) { %> <%= nvl.toBlank(noOfTrans).substring(0,len1 - 6) %>.<%= nvl.toBlank(noOfTrans).substring(len1 - 6,len1 - 3) %>.<%= nvl.toBlank(noOfTrans).substring(len1 - 3,len1) %> <% } %>
<% if (len1 > 9 && len1 <=12) { %> <%= nvl.toBlank(noOfTrans).substring(0,len1 - 9) %>.<%= nvl.toBlank(noOfTrans).substring(len1 - 9,len1 - 6) %>.<%= nvl.toBlank(noOfTrans).substring(len1 - 6,len1 - 3) %>.<%= nvl.toBlank(noOfTrans).substring(len1 - 3,len1) %> <% } %>
</td>
<% } %>
<% --i; %>
<td></td>
</tr><% } %>
<% if (user_count > 0) {
%><tr class="featurecontentbold" align="right" bgcolor="#E3F395">
<td></td>
<td align="center">Total</td>
<% for (int i = 0; i < firstcode_count; i++) { %>
<td>
<% len1 = nvl.toBlank(totalTrans[i]).length(); %>
<% if (len1 <= 3) { %> <%= nvl.toBlank(totalTrans[i]).substring(0,len1) %> <% } %>
<% if (len1 > 3 && len1 <=6) { %> <%= nvl.toBlank(totalTrans[i]).substring(0,len1 - 3) %>.<%= nvl.toBlank(totalTrans[i]).substring(len1 - 3,len1) %> <% } %>
<% if (len1 > 6 && len1 <=9) { %> <%= nvl.toBlank(totalTrans[i]).substring(0,len1 - 6) %>.<%= nvl.toBlank(totalTrans[i]).substring(len1 - 6,len1 - 3) %>.<%= nvl.toBlank(totalTrans[i]).substring(len1 - 3,len1) %> <% } %>
<% if (len1 > 9 && len1 <=12) { %> <%= nvl.toBlank(totalTrans[i]).substring(0,len1 - 9) %>.<%= nvl.toBlank(totalTrans[i]).substring(len1 - 9,len1 - 6) %>.<%= nvl.toBlank(totalTrans[i]).substring(len1 - 6,len1 - 3) %>.<%= nvl.toBlank(totalTrans[i]).substring(len1 - 3,len1) %> <% } %>
</td>
<% } %>
<td></td>
</tr><% } %>
<tr bgcolor="#CCCCCC" class="featurecontent">
<td colspan="<%= firstcode_count + 3 %>"><img src="../../images/line.gif" width="<%= widthA %>" height="3"></td>
</tr>
</table>
</div>