how to display the record in a single line in JSP?

Hi,

I have created one jsp file which just shows the records(fetched from database) in table format , It does not look good?part of date/time is on the second line, the NumberOfFiles is on the second line. All fields should start and end on the first line with the Description (which can take more than 1 line)

Here is my code :

<%@ page import="com.gen.vr.dash.*,java.sql.*,java.util.*,java.text.*" %>

<jsp:useBean id="basicOperation" class="com.gen.vr.dash.VRContentDashBoardOperation" />

<html>

<HEAD>

<TITLE>Status Page </TITLE>

<META NAME="Generator" CONTENT="EditPlus">

<META NAME="Author" CONTENT="">

<META NAME="Keywords" CONTENT="">

<META NAME="Description" CONTENT="">

<center>

<%@ include file="/DBMainScreen.jsp" %>

</center>

</HEAD>

<%

java.text.SimpleDateFormat sdfInput =new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss" );

java.text.SimpleDateFormat sdfOutput =new java.text.SimpleDateFormat("EEE, MMM d, yyyy hh:mm a");

DecimalFormat df =new DecimalFormat("#,##0");

VRContentDashBoard batchList[] =null;

batchList = basicOperation.getContentBatches();

String timeStampReceived=null;

String timeStampPublished=null;

String timeStampUploaded=null;

String timeStampValidated=null;

String timeStampException=null;

java.util.Date dateReceived=null;

java.util.Date datePublished=null;

java.util.Date dateUploaded=null;

java.util.Date dateValidated=null;

java.util.Date dateException=null;

%>

<form>

<blockquote>

<table BORDER="0" align="center">

<tr>

<th bgcolor=#C6C3C6 align="left" width="50" >BatchID</th>

<th bgcolor=#C6C3C6 align="left" width="50" >NoOfContentFiles</th>

<th bgcolor=#C6C3C6 align="left" width="50">DateTimeStamp</th>

<th bgcolor=#C6C3C6 align="left" width="50">Status</th>

<th bgcolor=#C6C3C6 align="left" width="50">Exception Description</th>

</tr>

<%

for(int i=0; i<batchList.length; i++)

{

VRContentDashBoard batch = batchList[i];

timeStampReceived = batch.getDateTimeStampReceived();

if(timeStampReceived!=null)

dateReceived = sdfInput.parse(timeStampReceived);

else dateReceived=null;

int noOfContentFiles = df.parse(batch.getNumberOfContentFiles()).intValue();

timeStampPublished = batch.getDateTimeStampPublished();

if(timeStampPublished!=null)

datePublished = sdfInput.parse(timeStampPublished);

else datePublished=null;

timeStampUploaded = batch.getDateTimeStampUploaded();

if(timeStampUploaded!=null)

dateUploaded = sdfInput.parse(timeStampUploaded);

else dateUploaded=null;

timeStampValidated = batch.getDateTimeStampValidated();

if(timeStampValidated!=null)

dateValidated = sdfInput.parse(timeStampValidated);

else dateValidated=null;

timeStampException = batch.getDateTimeStampException();

if(timeStampException!=null)

dateException = sdfInput.parse(timeStampException);

else dateException=null;

if(batch.getStatus().trim().equals("Received"))

{ %>

<tr>

<td align="left"><%= batch.getBatchId() %> </td>

<td align="left"><%= df.format(noOfContentFiles) %> </td>

<%if(dateReceived!=null){%>

<td align="left"><%= sdfOutput.format( dateReceived ) %> </td>

<%}

else{ %> <td align="left"> </td> <%} %>

<td align="left"><%= batch.getStatus() %> </td>

</tr>

<%}

elseif(batch.getStatus().trim().equals("Published"))

{ %>

<tr>

<td align="left"><%= batch.getBatchId() %> </td>

<td align="left"><%= df.format(noOfContentFiles) %> </td>

<%if(datePublished!=null){ %>

<td align="left"><%= sdfOutput.format( datePublished )%> </td>

<%}

else{ %> <td align="left"> </td> <%} %>

<td align="left"><%= batch.getStatus() %> </td>

</tr>

<%}

elseif(batch.getStatus().trim().equals("Uploaded"))

{ %>

<tr>

<td align="left"><%= batch.getBatchId() %> </td>

<td align="left"><%= df.format(noOfContentFiles) %> </td>

<%if(dateUploaded!=null){%>

<td align="left"><%= sdfOutput.format( dateUploaded )%> </td>

<%}

else{ %> <td align="left"> </td> <%} %>

<td align="left"><%= batch.getStatus() %> </td>

</tr>

<%}

elseif(batch.getStatus().trim().equals("Validated"))

{ %>

<tr>

<td align="left"><%= batch.getBatchId() %> </td>

<td align="left"><%= df.format(noOfContentFiles) %> </td>

<%if(dateValidated!=null){ %>

<td align="left"><%= sdfOutput.format( dateValidated )%> </td>

<%}

else{%> <td align="left"> </td> <%} %>

<td align="left"><%= batch.getStatus() %> </td>

</tr>

<%}

elseif(batch.getStatus().trim().equals("Exception"))

{ %>

<tr>

<td><%= batch.getBatchId() %> </td>

<td align="left"><%= df.format(noOfContentFiles) %> </td>

<%if(dateException!=null){ %>

<td align="left"><%= sdfOutput.format( dateException )%> </td>

<%}

else{%> <td align="left"> </td> <%} %>

<td><%= batch.getStatus() %> </td>

<td align="left"><%= batch.getExceptionDescription() %> </td>

</tr>

<%}

}

%>

</table>

</blockquote>

</form>

</html>

Regards

venki

[10648 byte] By [Annamalaii1a] at [2007-10-3 5:22:49]
# 1
If "it does not look good", you need to improve your HTML.
CeciNEstPasUnProgrammeura at 2007-7-14 23:29:53 > top of Java-index,Java Essentials,New To Java...
# 2
how do i improve the HTML? i mean displaying the record in a single line the fields which i mentioned are DateTimeStamp,NumberOfFiles.Plz provide me the solution.which attribute in <table> <td> which displayes the value in a first row ?
Annamalaii1a at 2007-7-14 23:29:53 > top of Java-index,Java Essentials,New To Java...
# 3

I'm still not sure what you mean, but I simply mean: if your HTML sucks, make sure your JSP results in better HTML. There is no magic in JSPs that makes them different from any other HTML in a browser.

I have to guess your problem: do you have line wraps you don't want? I think that's best fixed with CSS. I wouldn't know a way in pure HTML, since using &nbsp;s might not break a line on spaces, but still on hyphens.

CeciNEstPasUnProgrammeura at 2007-7-14 23:29:53 > top of Java-index,Java Essentials,New To Java...
# 4
Yes sir, i dont want line wraps in some fields .whats the attribute which will perform that operation?regardsvenki
Annamalaii1a at 2007-7-14 23:29:53 > top of Java-index,Java Essentials,New To Java...
# 5
> whats the attribute which will perform that> operation?I don't know. Ask at some CSS board.
CeciNEstPasUnProgrammeura at 2007-7-14 23:29:53 > top of Java-index,Java Essentials,New To Java...
# 6
Sir, i simply did it by using the following code. <td nowrap>Thanks for your hint!regardsvenki
Annamalaii1a at 2007-7-14 23:29:53 > top of Java-index,Java Essentials,New To Java...