[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

Wrap text in table row.

Hallo experts.
In a table row i get text from a recordset like
<tr>
  <td><cfoutput>#dboartikel.Test#</cfoutput></td>
</tr>
what must i do so that every 80 letters the text will wrap?
And if the text is 400 letters  what must i do if i want only the 200 of it an the rest as (....).
The numbers i used are only for understanding the question.The answer can be in pixels or anything.
thx
panos
0
Panos
Asked:
Panos
  • 7
  • 5
1 Solution
 
yo_s_cantaCommented:
Split text in 80 chars lines:
<tr>
  <td><cfoutput>#Wrap(dboartikel.Test,80)#</cfoutput></td>
</tr>
Warp just 80 chars:
<tr>
  <td><cfoutput>#Wrap(dboartikel.Test,80,true)#</cfoutput></td>
</tr>

Have a nice day,
Andrew
0
 
PanosAuthor Commented:
Hallo Andrew.
Testing your code i have a result like this:
Taxi,Behindertengerecht,ABS,Parkhilfe,Airbag,Regen
sensor,Beifahrerairbag,Elektr. Fenster
vorne,Seitenairbag,Elektr. Fenster
hinten,Traktionkontroll,ESP,DVD,Nebelscheinwerfer
,Radiokassete.

Do you know why or is this normal?
How can i split the text (the second question)?
(Show only a part of the text for example 100 char and for the rest this [.....]
thx
Panos
0
 
yo_s_cantaCommented:
Look here http://livedocs.adobe.com/coldfusion/6.1/htmldocs/funca119.htm 
You can do the wrap with css also. like this
<table width="100%">  
<tr>
<td width="180" style="overflow: hidden;">#(test)#</td>
<td width="180" style="overflow: scroll;">#(test2)#</td>
<td width="180" style="white-space: nowrap;">#(test3)#</td>
<td width="180" style="word-wrap: break-word;">#(test4)#</td>
</tr>
</table>
For the 2nd question use : Wrap(dboartikel.Test,80,true)      (true turn strip on)
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
PanosAuthor Commented:
Hallo Andrew.
Thank you for your help.
I didn't get it with CSS but with the first solution it is OK.
Please help me a bit more with the second question if you want.
This is the text i have now:
<td width="60">#Wrap(dboartikel.Besonderheiten,40,true)#</td>.
I want only two lines of text and on the [...].
I did see the link you gave me but my english is not so good to understand the function.
regards
panos
0
 
yo_s_cantaCommented:
There is a function Mid(string, start, count)
<td>#Mid(dboartikel.Besonderheiten,1,60)#</td>
0
 
PanosAuthor Commented:
Hallo Andrew
With the Mid function i have an cfoutput text from the first(1) to the 60 character on one line.
I need only two lines of text and on the end like this [...].
regards
panos
0
 
PanosAuthor Commented:
Hallo again.
Is there any function with Wrap...... and Max char?
without the [....] in the end?
Because i get these values form a column with a number off text that i did get from a checkbox group
can i have an output with wrap and max text(words)?
0
 
yo_s_cantaCommented:
I do not understand
0
 
PanosAuthor Commented:
I will try again to explain it to you.
I show you two result pages of car search engines.
1.
http://suchen.mobile.de/fahrzeuge/search.html?isSearchRequest=true&scopeId=C&country=&negativeFeatures=EXPORT&lang=de&sortOption.sortBy=price.consumerGrossEuro&sortOption.sortOrder=ASCENDING&makeModelVariant1.makeId=1900&makeModelVariant1.modelId=9&maxPrice=&minFirstRegistrationDate=2008-01-01&maxMileage=&fuel=&zipcode=&zipcodeRadius=&doSearch.x=57&doSearch.y=9
2.
http://autoscout24.de/List.aspx?vis=1&make=9&model=1626&fregfrom=01%2f01%2f2008+00%3a00%3a00&fregto=12%2f31%2f2008+00%3a00%3a00&pricefrom=1000&cy=D&page=1&maxresults=500&results=20&um=True&sort=price&zipc=D
On the first page the last line of each result is what has been inserted in one column from a check box group but it has a limit of words in the output on the page on one line only.
In the second page the results are on two pages with a limit of words and if there is more of it it has this (... ยป )
.
I hope you can understand it now.
regards panos
0
 
PanosAuthor Commented:
sorry
......on two lines....
i mean
0
 
yo_s_cantaCommented:
<cfset inputText=Mid(dboartikel.Besonderheiten,1,60)>
<cfoutput>#Wrap(inputText, 59)#</cfoutput>

P.S. I don't work with coldfusion , I just searched on google
Hope that work
0
 
PanosAuthor Commented:
Thank you Andrew.
I will make a new question for my second question.
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now