473,387 Members | 1,664 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,387 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 3165
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.