You are here: Re: Long text in a table does not wrap? « HTML « IT news, forums, messages
Re: Long text in a table does not wrap?

Posted by Simon on 03/23/06 11:17

>
>> The problem is many fold.
>
> Indeed, and the problem you described isn't your real problem.

Not true at all.

>
>> First I run a blog host site, so the user can
>> enter what they want,
>
> Don't let them do that.

Yes I will, this is the service I offer and this is the service they will
get.
My job is to bend over backward for the users rather than preventing them
from doing something because I don't have the right skills.

>
>> (and I don't want to stop them).
>
> Then accept the consequences (including spam that will be sent - I find it
> odd that you take destructive measures - fake address in From field -
> against
> suspected E-mail spam, which can be handled rather well these days, but
> don't
> worry the least about blog spam).

No, I have many filters to prevent spam, no code is executed on the server.
No script is executed on the client machine, (no JavaScript is allowed).

I am not going to stop them from outputting something on the screen because
you don't know how to control malicious code.

>
>> Sometimes they enter links that are 200 characters long
>
> You are not inserting the URLs as text, are you?

No, they are. It is one of their option of they want.

> Decent blog software should be able to let users enter real links, with
> link texts and URLs as separate
> things and with URLs used in the internal code (HTML source) only.

No, again you are confusing what you want to see happening and what the user
wants.
If they want to output a link that is +200 chars long then I will oblige.

>
>> or things like "I
>> am soooooooooo.[x200chars]..ooo bored"
>
> Prevent it or accept the consequences.

See above, they can enter what they wish.
What would, (could?), be the consequences of a 200 chars word?

>
>> Then on the homepage I display the last 25 messages, (the first 45 words
>> or 250 chars).
>
> So you truncate messages but not words. What's the point?

Just to display on the home page. I am not truncating any of their message.
I am just finding a practical way of displaying the last 25 messages.

>
>> In fact at the moment it is fine, and I was a bit lucky to notice the
>> problem.
>
> This sounds like the explanation to what the common saying "No problem"
> really means (in some cultures at least): there is a problem, but it has
> not
> exploded yet.

Your concept of preventing anything that you cannot fix is a much bigger
problem in my opinion.

>
>> That is why I wanted to break the long words.
>
> Huh? So why don't you do that? Why would you try to leave it to browsers,
> which have even less an idea of what is going on?

What does that mean?
Why don't I do what? Break long words? Yes, I can do it, but to what length?
10 chars, 20chars or 100 chars for big screens?

>> I could check every entry for words that are more than 'xx' chars in a
>> row but I was hopping to find a simpler way,
>
> Surely. Check for the lengths of "words", with "word" defined as a maximal
> sequence of non-whitespace characters, and truncate a "word" longer than a
> reasonable limit, preferably indicating the truncation and making the
> unabridged version available somehow, e.g. making
> sooooooooooooooooooooooooooooooooooooooooooooooooooo
> appear as
> <span title="sooooooooooooooooooooooooooooooooooooooooooooooooooo">
> soooo<span class="trunc">[&#8230;]</span>ooo</span>
> with some suitable styling like
> .trunc { color: #555; background: white; }
> to indicate that the notation is not part of actual user input.

Yes that is one possibility of course. It does look elegant as well.

>
> The reasonable limit depends on the language, of course.

It is only for display on the home page, I am not truncating their real
entries.

>
>> I think that kind of problem should be handled client side.
>
> You are very wrong here.
>

No, if they have a very wide screen then 'xxx' chars can be shown.
If they have a tiny screen then only 'xx' chars can be seen.

Simon

 

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

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