• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Breaking a word in a TD

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am having problem in displaying a text in a TD in table. My req. goes like this. I have a discussion form, in which a person can post a comment. The comment is displayed as a single line link in the view page. For eg. if a person gives a comment for 2000 chars. I would be showing what ever it can accomodate in a particular TD. My TD width is 25%. When a particular line exceeds this 25%, the remaining characters are stripped off. When a person replies to this comment, a few sapces are given infront and displayed as separte row below this. Now also it should be displayed as single line link but the effecrtive width is reduced.And it goes like this.

I want to know is there a any way to strip of the charactes to width of particular TD in a table.

Thanks in Advance.

Regards,
Arul.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can try using overflow="hidden" on the cell, but do not think that will work with percentages. Why don't you just cut the lenght to a cerain size on the server?

Eric
 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Eric for Quick reply.
I tried out even with Px, it did not work out.

Please find the code below.

<TD COLSPAN="1" CLASS="ACTS_Fld_Vl" ALIGN="left" style='width:500px;overflow:hidden ;'>
<%out.println(CommentsUtil.generateSpace(objCommentsDTO.getLevel()));%>
<%if (objCommentsDTO.getStrDisplaySubject() != null && objCommentsDTO.getStrDisplaySubject().equalsIgnoreCase("No Comment")) {%>
<IMG src="images/news_unselected.gif" width="12" height="16"> <B><%=strValue%></B>
<%} else {%>
<IMG src="images/news_unselected.gif" width="12" height="16">
<A href="javascript:funComment('<%=objCommentsDTO.getSeqID()%>',
'<%=objCommentsDTO.getStrDisplaySubject().trim()%>','<%=i%>')">
<%=ComentsUtil.parseContent(strValue)%> </A>
<%}%>
</TD>

We dont know how many character can be accomodated in a particular TD. So that we can calculate number of character at server level. If you could provide us any suggestion it could be of great help.

Regards,
Arul.
reply
    Bookmark Topic Watch Topic
  • New Topic