• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Generating table with servlet

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes sure we can create table using servlets also same as html.
 
Mark Leong
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
have you tried?
out.println("<table width=\"200\">");

hope it helps... and let me know if you sort it out
 
Mark Leong
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.
That was actually what I first tried.
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Mark Leong
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
It's feeding time! Give me the food you were going to give to this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic