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

FireFox text wrapping 1

Status
Not open for further replies.

PGoRule

Programmer
Jul 26, 2006
438
IN
I have a Table. In one column i display URL's. Now the problem is if the url is really long , then unlike other browsers, which my web application supports, in firefox, the URL does not wrap to the next line. Worse still when I resize the window it moves to the next cell and overlaps with text in that cell. As this is intranet application, so can not use tinyurl. It can not be wrapped as there are no white spaces inside the URL and if I break the URL string then redirect causes problem due to that string.

Any ideas how to wrap the text to the next line?

Sharing the best from side...

--Prashant--
 
You could try playing with the ' table-layout:fixed ' style, but failing that, you won't be able to, AFAIK.

You could put ' overflow:auto ' on the cell, giving a scrollbar if the content is too large, however.

Failing that, you could resort scripting to insert a natural break in the displayed text.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
The URLs are in one column of Datagrid. These URLs points to the object at the location which corresponds to the data in other columns.
I tried it a lot by specifying Column width as Fixed, Overflow , table layout, White-space:-moz-break-word...Nothing is working with FF. At the same point IE gives the perfect result.
Plz. can anyone tryout for this?


Sharing the best from my side...

--Prashant--
 
Could you first elaborate why krgbert's idea is not ok with you? CSS3 value for breaking words at arbitrary points is [tt]word-wrap: break-word;[/tt]. There is however no -moz extension that is similar to this property. If CSS3 one does not work in FF, then I guess you have no choice but:

1. Use the anchor element and give the link a short name.
2. Use the anchor element and break the name of the link only in what is displayed via server-side language.
 
pgorule,

I'm not sure if this is going to work at all, but try putting the html entity [tt]­[/tt] in the link text, for every so many chars you like...

[tt]­[/tt] tells where to wrap up "otherwise non-wrappable text".

Not sure it will work if a users copies the link text from the screen though...

Try and let's hear if it worked.

Regards


Jakob
 
Thanx Vragabond & dkdude...
That solution works fine, it breaks the long URL into the parts, but ­ remains in the URL part, so when user clicks that URL, it shows page not found.
As per the clients words, there must be full URL to get the idea which object that link is holding and at what place. We have given many ideas to client to change this behavior, but no way...The IE supports everything, the problem is with FF.

I didn't get this point:
Use the anchor element and break the name of the link only in what is displayed via server-side language. Can you explain it further?

Sharing the best from my side...

--Prashant--
 
Something like:
Code:
<a href="[URL unfurl="true"]http://www.verylonglink.com/at/this/really.php?complicated=website">http://www.verylonglink.com/at[/URL] /this/really.php?complicated=website</a>
Whereas your server-side script would determine where to put that little space. Now if a person clicks on the link, it works, the link is displayed and it wraps. If someone wants to copy the link into the browser instead of clicking on it, then they can delete those extra spaces.
 
Thanx a million...Vragabond,
That helped a lot...Now I have the results as per the requirement. A star for you...


Sharing the best from my side...

--Prashant--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top