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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

very big long string

Status
Not open for further replies.

TruthInSatire

Programmer
Aug 12, 2002
2,964
US
I have a table that I would like to fit on one page. The table is set to 100% the problem is one of the cells has a url in it that causes the table cell to stretch about 500 characters (it doesn't have any breaking characters or end of line puncuation like "?" or " " or anything). is there anyway to force the url string to break automaticaly where the cell ends rather than stretch the cell?

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
I don't think you can force a break. What you can do though is use a style to define what you want to happen when the text is so long.

.tablecell {
overflow: scroll;
}

MrBelfry
 
How bout
Code:
<a href=&quot;[URL unfurl="true"]http://www.ridicolouslylongURLgoeshere.com/continuefor500chars.html&quot;[/URL] title=&quot;Click to go to blah&quot;>This URL is too long</a>

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
Thank you both.

MrBelfry: The CSS didn't work. is that the CSS equal to &quot;nowrap&quot;? I did try that.

Clarkin: That isn't a bad Idea however the url is tossed into a large memo field with other notes/descriptions. Also its ment to be a printable report so putting a &quot;click here&quot; link wouldn't quite do the trick.

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
The css should put scrollbars on the table cell

try

td {
overflow: scroll;
}

or one of the other values of the overflow property

MrBelfry
 
hmm, i tried putting that in my css page and nothing happened (yes its linked) both .tablecell class and the td{} suggestion. i've never used the overflow property, is there anything special i need to do? I also tried overflow: hidden; but that didn't do anything either.

i currently have the tabel cell width set to &quot;200&quot; i've also tried &quot;16%&quot;

if i set it to 200 al the text wraps except for the long url's (that's how I found the problem)

A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
>>Clarkin: That isn't a bad Idea however the url is tossed into a large memo field with other notes/descriptions. Also its ment to be a printable report so putting a &quot;click here&quot; link wouldn't quite do the trick.

bit more clear?

Known is handfull, Unknown is worldfull
 
vbkris:
The data is coming out of a memo field in a database. so it the information in the out put could be somthing like
&quot;this is the description for this application. Its pretty neat and does some cool stuff, here is more information concerning this application:
everything in the &quot;&quot;'s needs to be visible in the printed report. (Printed i.e. hardcopy) i've tried a replace function to change &quot;&&quot; to &quot;&<br>&quot; but now the problem is i get out put like:
col=hpcom+ccen+ccenfor&
qs=&
qc=&
la=en&
qm=0&
st=1&
lk=1&
rf=0&
uf=1

and I found another long link with no &quot;&&quot; in it:

causing the cell to stretch from:
http:// to the ?



A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
- Quote by Douglas Adams
 
What about displaying it in a textarea and adjusting the height of that dynamically to fit the content?

Also, not totally sure about the cross-browser nature of this but what about replacing slashes in long url's with %2f

IE wraps a long url at a few different characters and a % sign is one of them. The url would still be valid.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top