473,395 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Fundamental problem with HTML, or am I missing something?

When you have a long string like
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
in an html table, it pushes the table out so you have to scroll to the
right. I've tried width=100%, width=500, both in the <td> and in
<table>, have tried all the stylesheet suggestions I've found in
google and it doesnt work. Ideally I'd rather have the text
force-wrapped, else just hidden than breaking the whole page's table.

Heres the site: www.hazara.org/guestbook.php

Sure I can remove the entries or use php to wrap the strings, I'd
rather use HTML+CSS for the sake of correctness. I've tried firefox
1.0, IE6.0, Mozilla, Netscape 7.2, Opera 7.x, Konquerer.
Jul 23 '05 #1
5 5136
Previously in comp.infosystems.www.authoring.html, Ghazan Haider
<gh***********@gmail.com> said:
When you have a long string like
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
in an html table, it pushes the table out so you have to scroll to the
right.
Yes. This is normal and expected. My newsreader does the same thing with
long lines of text.
Ideally I'd rather have the text
force-wrapped, else just hidden than breaking the whole page's table.
Wrapping the text randomly could change the meaning. And whether the
text is too long or not in the first place depends on several factors,
including canvas width and font size.
Sure I can remove the entries or use php to wrap the strings,
Indeed.
I'd
rather use HTML+CSS for the sake of correctness.


Problem is, neither HTML or CSS can do what you want. HTML simply
describes the structure of the content. It doesn't change the content
itself. CSS merely suggests a presentation for the content.

Trying to use HTML or CSS for something they are not designed for, for
the sake of correctness, is worse than pointless.

--
Mark Parnell
http://www.clarkecomputers.com.au
Jul 23 '05 #2
gh***********@gmail.com (Ghazan Haider) wrote:
When you have a long string like
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a
in an html table, it pushes the table out so you have to scroll to the
right.
Yes. This is the correct behaviour as per the HTML and CSS specs. Any
widths given to tables or table cells are suggestions and can be
ignored by browsers in order to fully display the content. After all
the content of a table is more important than a presentation
suggestions.
I've tried width=100%, width=500, both in the <td> and in
<table>, have tried all the stylesheet suggestions I've found in
google and it doesnt work. Ideally I'd rather have the text
force-wrapped, else just hidden than breaking the whole page's table.
No way to "force wrap" it without inserting either <br> elements or
permitted line break characters (such as a space) into the text.

If you want the text hidden then overflow: hidden for the <td> should
do the trick. But if you're hiding the content you might as well
delete it.
Heres the site: www.hazara.org/guestbook.php
I don't see any need to use a table at all for that page, except
possibly for the form.
Sure I can remove the entries or use php to wrap the strings, I'd
rather use HTML+CSS for the sake of correctness.


Using a programming language to programmatically edit the content so
that it suits your requirements is the correct way to go.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 23 '05 #3
gh***********@gmail.com (Ghazan Haider) wrote:
When you have a long string like
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaa in an html table, it pushes the table out
so you have to scroll to the right.
Then don't put such a string into your table. I can understand why people
write "aaaaaaargh!", but so many a's in succession really don't make sense,
or even an impression.

And don't let others put such strings into your page either.
Heres the site: www.hazara.org/guestbook.php


Guestbooks are a constant source of confusion and problems, especially when
implemented using defective software and without adequate control
arrangements. Don't expect HTML to solve such problems.

Make the guestbook software reject or truncate or otherwise handle "words"
that exceed a reasonable limit, say 42 characters. Include a note about
this into the usage instructions.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #4
Jukka K. Korpela was zeer hard aan het denken :
gh***********@gmail.com (Ghazan Haider) wrote:
When you have a long string like
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaa in an html table, it pushes the table out
so you have to scroll to the right.
Then don't put such a string into your table. I can understand why people
write "aaaaaaargh!", but so many a's in succession really don't make sense,
or even an impression.

And don't let others put such strings into your page either.


Indeed.
Heres the site: www.hazara.org/guestbook.php


Guestbooks are a constant source of confusion and problems, especially when
implemented using defective software and without adequate control
arrangements. Don't expect HTML to solve such problems.


Couldn't agree more.
Make the guestbook software reject or truncate or otherwise handle "words"
that exceed a reasonable limit, say 42 characters. Include a note about
this into the usage instructions.


I don't think it would be a good idea to software reject or truncate
strings that exceed a 'reasonable limit'. What's reasonable anyway?

This could have various annoying side-effects (think about
programming-code expressions longer than 42 characters; or for the sake
of amusement, consider an inhabitant of
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysilio gogogoch to post his
town name ;-))

My approach to the wrapping-problem has been not to force a thing
lay-out-wise, and to put possibly long content in a overflow:scroll
styled block level element.

The key to this however seems to be human revision of the texts. Only a
human can decide on how wrapping could change the meaning of the text.

just my ¤.02

Vincent

--
Dit is een automatische handtekening van MesNews.
Site : http://mesnews.no-ip.com

Jul 23 '05 #5
Vincent De Baere <vd******@lilly.csoft.net> wrote:
Make the guestbook software reject or truncate or otherwise handle
"words" that exceed a reasonable limit, say 42 characters. Include a
note about this into the usage instructions.
I don't think it would be a good idea to software reject or truncate
strings that exceed a 'reasonable limit'. What's reasonable anyway?


Whatever the guestbook maintainer finds reasonable. It's his forum, he
tells the rules, and a good host tells the rules to the guest before or at
least upon entry. Just as he can forbid talk about sex or religion, he can
impose technical limitations - which would often be easier to understand
and accept.
This could have various annoying side-effects (think about
programming-code expressions longer than 42 characters; or for the sake
of amusement, consider an inhabitant of
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysilio gogogoch to post his
town name ;-))
If you set up a guestbook, you can decide whether such postings will be
allowed, or set rules on handling them. Actually I think you _should_,
given that the postings will appear as part of an HTML page, where such
oddities can cause confusion. In many guestbook designs, they may disturb
other people's postings as well (by changing the page's overall appearance,
perhaps even the width of the page as a whole).

There are many ways to handle too long strings. An interesting idea just
came into my mind:
<span title="Llanfairpwllgwyngyllgogerychwyrndrobwllllan tysiliogogogoch">
Llanfair…</span>
(It would be more logical to use <abbr> instead, but we know IE.)

Of course, such handling (or any handling) needs to be done in the server-
side software that runs the guestbook.
My approach to the wrapping-problem has been not to force a thing
lay-out-wise, and to put possibly long content in a overflow:scroll
styled block level element.


If you decide to do so, I think the handling (in a guestbook) should be
made on a per-contribution basis. Each contribution should be a <div>
element, with width: 100% and overflow: auto, so that if it contains too
long lines, only that contribution needs horizontal scrolling.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Steve | last post by:
I want to learn PHP. To date all I've used is Frontpage. What is the first step? Should I move to Dreamweaver or something else, then get into PHP? Thanks, Steve
51
by: Casper Bang | last post by:
My question is fundamental I beleive but it has been teasing me for a while: I have two classes in my app. The first class is instantiated as a member of my second class. Within this first class,...
3
by: Kyle Kolander | last post by:
I recently looked over the faq item relating to fundamental type sizes: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5 and was a bit surprised, as I had been taught more-or-less the...
8
by: Kyle Kolander | last post by:
Sorry, I sent this to comp.std.c++ and meant to send it here as well... Why are the minimum size guarantees for fundamental types intentionally omitted from section 3.9.1 Fundamental types of...
1
by: JohnK | last post by:
I have a GridView MyClass List = new MyClass ; for (int i = 0; i < 10; i++) { List = new MyClass(); List.FirstName = " First " + i; List.LastName = " Last " + i; }
23
by: Peter | last post by:
I have a problem with a page show_image.asp that returns a jpg image under Windows XP Pro SP2. The page sets content type as: Response.ContentType = "image/jpg" While this works perfectly fine...
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.