Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Breaking a word in a TD

 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • 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.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic