• Post Reply Bookmark Topic Watch Topic
  • New Topic

Limiting number of characters in a Table  RSS feed

 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Need some help with html tables. Need to limit the number of characters in a certain cell to 30.

I am using html in a jsp page.

<td><c:out value="${xyz}"/></td>

Tried using <td width="30">, but that does not work.

Any idea how to go about it?

Thanks
Praneet
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some Googling might help:
limit the number of characters in a <table> td
 
Praneet Mirchandani
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Actually, I tried that. But could not figure out. So I posted it here.



 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh, I found the best way, Using JSTL:
http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/substring.fn.html

OR

JavaScript to restrict the number of character, like


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!