File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Generating table with servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Generating table with servlet" Watch "Generating table with servlet" New topic
Author

Generating table with servlet

Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
I am using servlet to generate a table:-
out.println("<form>");
out.println("<table width=200>");
do something here......
out.println("</table>");
out.println("</form>");
Somehow the width=200 does not seem to work.
When I use pure html, it works perfectly.
Anybody has the same experience?
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
yes sure we can create table using servlets also same as html.
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
What I am trying to say is that the width attribute of the tables does not seem to work when the table is generated by servlet.
I have a very long text insert the table cell. I find that if I create the table by writing the html page manually, the table maintained its width of 200 and the text got wrapped round.
However if the table is generated through a servlet, the text flow out of the screen to the right.
Andres Gonzalez
Ranch Hand

Joined: Nov 27, 2001
Posts: 1561
have you tried?
out.println("<table width=\"200\">");

hope it helps... and let me know if you sort it out


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Thanks.
That was actually what I first tried.
WiLL Tao
Ranch Hand

Joined: Dec 14, 2001
Posts: 56
Originally posted by Mark Leong:
I am using servlet to generate a table:-
out.println("<form>");
out.println("<table width=200>");
do something here......
out.println("</table>");
out.println("</form>");
Somehow the width=200 does not seem to work.
When I use pure html, it works perfectly.
Anybody has the same experience?

out.println("table width='200'");
-----------------
hope it works


Thank Folks who <b>Make Sense</b> here.<br />SCJP Platform 2
Mark Leong
Ranch Hand

Joined: Dec 11, 2000
Posts: 60
Thanks for all the help. I found the problem.
I've placed a <pre></pre> tag within the cell. Removed it and all is OK.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Generating table with servlet