You are here: Re: Wrap long URL in table « HTML « IT news, forums, messages
Re: Wrap long URL in table

Posted by Scott Gordo on 09/22/06 13:50

Brian Cryer wrote:
> "Jukka K. Korpela" <jkorpela@cs.tut.fi> wrote in message
> news:%FDQg.17342$8M5.10225@reader1.news.jippii.net...
> > Jim Moe wrote:
> >
> >> Do not use the URL as the displayed text.
> >
> > Agreed.
> >
> >> Or you can add arbitrary spaces to the URL every nth character but
> >> then the URL text cannot be copied/pasted.
> >
> > No, that's a wrong approach. If you _really_ must put URLs as text on a
> > web page, throw in some <wbr> tags after suitable characters, such as "?",
> > "/", and "&". See
> > http://www.cs.tut.fi/~jkorpela/html/nobr.html#suggest
>
> The <wbr> tag is great, widely supported but isn't in the w3c spec, so if
> you use it then your page won't validate. I know this because I used to make
> frequent use <wbr> until I got my fingers burnt over validation.
>
> As an alternative, why not use the word-wrap css, for example:
>
> <p style="width: 5em; word-wrap: break-word">12345678901234567890</p>
>
> should render as two or more lines (depending on your font settings). Of
> course to use this you have to know the maximum width you want - but the OP
> knew his width.
> --
> Brian Cryer
> www.cryer.co.uk/brian

Thanks all. Now, instead of wrapping, I think that what I'm really
looking for is what google did to my original post. After a certain
number of characters, google automatically cut it off and inserted
ellipses.There was maybe another ten characters it lopped off.
I think I need a script that recognizes any code that starts with
">http://" and limits it to a certain number of characters (say 30)
before cutting it off and inserting ellipses, while leaving the "<a
href="http://" alone.
Any ideas or leads?

Scott

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация