Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT: Table defination question....

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hello,

I have question about XSLT. I have table with many columns. I want to restrict one of the table column no bigger that say 20 characters. But the problem is value I am putting in from XML file may have words which are longer than 20 characters and so table goes wide... !
e.g if the word is testverylongstringgreaterthantwentychar .
What happens is table goes wider.. and don't restrict it to 20 characters and rest show in next row..
I would like to have output something as follows..
testverylongstringic-
hgreaterthantwentych-
ar

Here is the sample of table defination within XSLT

<TABLE BORDER=&quot;true&quot; CELLSPACING=&quot;1&quot; CELLPADDING=&quot;4&quot; WIDTH=&quot;98%&quot;>
<TR>
<TD WIDTH=&quot;20%&quot; VALIGN=&quot;TOP&quot; BGCOLOR=&quot;#66cccc&quot; HEIGHT=&quot;10&quot;>
<B><center>
<FONT SIZE=&quot;2&quot;>
Attribute Name
</FONT>
</center></B>
</TD>
</TABLE>

Do anyone know anyway I can do what I need ? I would be more than happy even if you point me to right place (if you know) for the question I have.

Thanks a lot for your help,
Mehul.
mehul_k_mehta@msn.com
 
basically you need to use javascript with your xslt to test the string and split the string into twenty characters and then do a document.write
let me know if you need exact code

Sal
 
Hi Sal,

Thanks for prompt reply !
It would be very much useful if you could let me know exact code as i am not Java person :(

Thanks a lot for your help!!!!!!
Mehul.
 
Instead of saying 20% on the width of the cell, why not just put in a pixel value? There's CSS code that can you can use to format the table, also.

Endbringer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top