473,241 Members | 1,448 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,241 software developers and data experts.

Adding "soft-hyphen"

My PHP script builds a table that is too wide to fit on the paper. Two
of the columns contain strings that are more lengthy than data in the
other columns.

I can get the table to fit by letting the browser break the lengthy
strings across two or more lines, thus allowing the column to get
skinnier. I do this by inserting spaces in various places in the
string. But this is not a desirable solution as it would mislead the
user into thinking the string contains spaces when it doesn't.

Is there an invisible character code I can insert into the string that
tells the browser that it is allowed to line-wrap the string at this
place, if needed? Popular word processors have a feature like this
called "soft hyphens" or "soft breaks", etc.

Mark
Sep 12 '05 #1
8 3150
Mark wrote:
My PHP script builds a table that is too wide to fit on the paper. Two
of the columns contain strings that are more lengthy than data in the
other columns.

I can get the table to fit by letting the browser break the lengthy
strings across two or more lines, thus allowing the column to get
skinnier. I do this by inserting spaces in various places in the
string. But this is not a desirable solution as it would mislead the
user into thinking the string contains spaces when it doesn't.

Is there an invisible character code I can insert into the string that
tells the browser that it is allowed to line-wrap the string at this
place, if needed? Popular word processors have a feature like this
called "soft hyphens" or "soft breaks", etc.


You must have something in your html/css that is preventing line wrap.
Default is for table text to wrap. Also check the way you have defined
table width - 90% will force the table to fit in the view size.

--
TK
http://www.wejuggle2.com/
Still Having a Ball
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?



..

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Sep 12 '05 #2
Terry wrote:

You must have something in your html/css that is preventing line wrap.
Default is for table text to wrap. Also check the way you have defined
table width - 90% will force the table to fit in the view size.

In Firefox, at least, text in cells will not be wrapped unless there is
a break point, such as whitespace. If a have long text without
whitespace in a column, such as a URL, Firefox will stretch the width of
the column to the minimum necessary to show the full string without a
line-wrap. I don't know if this is the case with IE, yet, as I am not
in a location that I have access to the password-protected page in question.

Mark
Sep 12 '05 #3
In article <dg**********@news.nems.noaa.gov>, Mark <Ma**********@noaa.gov>
wrote:
My PHP script builds a table that is too wide to fit on the paper. Two
of the columns contain strings that are more lengthy than data in the
other columns.

I can get the table to fit by letting the browser break the lengthy
strings across two or more lines, thus allowing the column to get
skinnier. I do this by inserting spaces in various places in the
string. But this is not a desirable solution as it would mislead the
user into thinking the string contains spaces when it doesn't.

Is there an invisible character code I can insert into the string that
tells the browser that it is allowed to line-wrap the string at this
place, if needed? Popular word processors have a feature like this
called "soft hyphens" or "soft breaks", etc.


Well, as far as I know, there is no way to tell the browser to linewrap a long
string to a certain width, only when the string is divided into words, but not
a consecutive string of characters.

A solution could be to put the long field on a row of its own, spanning the
width of the other values.

If the field values are:

1. Foo
2. Bar
3. Donkey
4. Monkey
5. VeryLongStringThatMessesUpWidth

And the table looks like this in crappy ASCII art:

+------+------+---------+---------+---------------------------------+
| Foo | Bar | Monkey | Donkey | VeryLongStringThatMessesUpWidth |
+------+------+---------+---------+---------------------------------+

And field 5 is the same for all lines in the report, you could divide it like
this:

<tr>
<td>Foo</td>
<td>Bar</td>
<td>Donkey</td>
<td>Monkey</td>
</tr>
<tr>
<td colspan='4'>VeryLongStringThatMessesUpWidth</td>
</tr>

Which, in crappy ASCII art would look like this:

+------+------+---------+---------+
| Foo | Bar | Monkey | Donkey |
+------+------+---------+---------+
| VeryLongStringThatMessesUpWidth |
+---------------------------------+

Set style="background-color: #CCC" on the first <tr> to make them be dividers
for each long value.

Hope this helped.

--
Sandman[.net]
Sep 12 '05 #4
On Mon, 12 Sep 2005 08:03:21 -0400, Mark <Ma**********@noaa.gov> wrote:
My PHP script builds a table that is too wide to fit on the paper. Two
of the columns contain strings that are more lengthy than data in the
other columns.

I can get the table to fit by letting the browser break the lengthy
strings across two or more lines, thus allowing the column to get
skinnier. I do this by inserting spaces in various places in the
string. But this is not a desirable solution as it would mislead the
user into thinking the string contains spaces when it doesn't.

Is there an invisible character code I can insert into the string that
tells the browser that it is allowed to line-wrap the string at this
place, if needed? Popular word processors have a feature like this
called "soft hyphens" or "soft breaks", etc.


Have a look at http://www.cs.tut.fi/~jkorpela/shy.html for a fairly involved
discussion of the HTML equivalent.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 12 '05 #5
Andy Hassall wrote:

Have a look at http://www.cs.tut.fi/~jkorpela/shy.html for a fairly involved
discussion of the HTML equivalent.


Actually, It was Jukka Korpela who pointed out in another post that I
could use the <wbr> tag to indicate a permissible place for a line
break. This is used inside <nobr> tags, which seems counter-intuitive
at first, but it gives you control as to exactly where you will permit a
line break and nowhere else...

I've already tried it, and <wbr> works well for IE, but Firefox just
ignores it.

Mark
Sep 12 '05 #6
On Mon, 12 Sep 2005 13:31:59 -0400, Mark <Ma**********@noaa.gov> wrote:
Andy Hassall wrote:

Have a look at http://www.cs.tut.fi/~jkorpela/shy.html for a fairly involved
discussion of the HTML equivalent.


Actually, It was Jukka Korpela who pointed out in another post that I
could use the <wbr> tag to indicate a permissible place for a line
break. This is used inside <nobr> tags, which seems counter-intuitive
at first, but it gives you control as to exactly where you will permit a
line break and nowhere else...

I've already tried it, and <wbr> works well for IE, but Firefox just
ignores it.


Neither <nobr> nor <wbr> exist in HTML 4.01, so Firefox is correct in ignoring
them.

http://www.w3.org/TR/html401/index/elements.html

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 12 '05 #7
>>
I've already tried it, and <wbr> works well for IE, but Firefox just
ignores it.

Neither <nobr> nor <wbr> exist in HTML 4.01, so Firefox is correct in ignoring
them.

http://www.w3.org/TR/html401/index/elements.html


It's _very_ unfortunate that neither Firefox or HTML 4.01 embrace this
useful tag. Furthermore, Firefox also ignores the ­ or ­ code
which _IS_ part of the HTML 4 standard
(http://www.w3.org/TR/html401/sgml/entities.html). Now I'm relegated to
having to post a message that says something to the effect of... "For
best results with a printed copy of this table, use Internet Explorer." :(

Mark
Sep 12 '05 #8
On Mon, 12 Sep 2005 14:35:37 -0400, Mark <Ma**********@noaa.gov> wrote:
I've already tried it, and <wbr> works well for IE, but Firefox just
ignores it.
Neither <nobr> nor <wbr> exist in HTML 4.01, so Firefox is correct in ignoring
them.

http://www.w3.org/TR/html401/index/elements.html


It's _very_ unfortunate that neither Firefox or HTML 4.01 embrace this
useful tag.


I think Firefox is correct in not supporting non-existent tags; nobody wants
the bad old days of <marquee><blink>made-up tags</blink></marquee> to be
encouraged.
Furthermore, Firefox also ignores the ­ or ­ code
which _IS_ part of the HTML 4 standard
(http://www.w3.org/TR/html401/sgml/entities.html).


But here I strongly agree with you; Firefox's lack of support for the proper
way of doing discretionary hyphens is unfortunate.

There is a change request for this, though, which you may want to add your
vote to:

https://bugzilla.mozilla.org/show_bug.cgi?id=9101

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Sep 12 '05 #9

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

Similar topics

14
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in -...
11
by: hokiegal99 | last post by:
How would I determine if a filename is greater than a certain number of characters and then truncate it to that number? For example a file named XXXXXXXXX.txt would become XXXXXX fname = files...
205
by: Jeremy Siek | last post by:
CALL FOR PAPERS/PARTICIPATION C++, Boost, and the Future of C++ Libraries Workshop at OOPSLA October 24-28, 2004 Vancouver, British Columbia, Canada http://tinyurl.com/4n5pf Submissions
4
by: JvdWal | last post by:
Hi, I've been trying the PDF & Mail Class Library from ACG Soft in combination with Northwind-2k3 style of db. Can someone help me with the error which is popping up: (which I cant get solved..)...
17
by: John Baker | last post by:
HI; I feel like a fool..I put CUTE FTP in my last request for help --it should have been CUTE PDF! I have FTP on my mind because I have been working on a web based application, and somehow my...
0
by: warenbe | last post by:
hi i've got a problem first sorry fot my bad english! i'm writing a soft wich send a file on a server using webclient.UploadFileAsync. it work fine but only with small files... in fact it...
4
by: Gérard Talbot | last post by:
Hello fellow stylers, What would be the best CSS equivalent of MSIE's wrap="off" and wrap="hard"? hard Text is displayed with wordwrapping and submitted with soft returns and line feeds. ...
26
by: Patient Guy | last post by:
The code below shows the familiar way of restricting a function to be a method of a constructed object: function aConstructor(arg) { if (typeof(arg) == "undefined") return (null);...
0
by: not_a_commie | last post by:
Here is some code for the Soft Heap, taken directly from the original paper on the subject with a little help from manish_gupta. Unfortunately, it's about half as fast as a basic binary heap simply...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.