NameSilo

Long url in multiple lines (Not in just a very long one)

SpaceshipSpaceship
Watch

broke-r

Established Member
Impact
1
How can I break very long URLs (generated dynamically) in two or more lines?

The "code":

<table>
<td>URL:</td><td>PHP_GENERATED_URL</td>
</table>

On the table above, if the link is very long, my page looks pretty ugly as everything moves to the right.

I have tried divs with css (word-wrap etc.), fixed width, but nothing seems to work.

Any ideas? Thanks!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Are you trying to do something like "host.com/somet...blah.php" where you replace the bulk of the url with an ellipsis? Or something else? Do you just want the url to wrap to many lines in the table?
 
1
•••
Thanks for the reply monaco. :tu:

No, I don't want an ellipsis. Just need to make the url break/split in several lines, (instead of just one), in order for long urls to stop making my site "stretch" to the right.

I have used word-wrap but it doesn't do the trick...
 
0
•••
At a guess, the CSS overflow property could hide excess text or the PHP wordwrap function could ensure it's a fixed length.
 
Last edited:
1
•••
Yes Daniel, the overflow property worked just fine! :tu:

Thank you very much guys! Rep added!!
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back