By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,337 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

word wrap problem

P: n/a
say i have the following table:

<table width="500">
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i need the width of the columns to STAY at 250 and wrap text that is longer
instead of blowing apart the whole table.
the tag "word-wrap: break-word;" works, but is only supported in IE. what
can i do to fix this?
Sep 28 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
momo wrote:
say i have the following table:

<table width="500">
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>
Then you should move to doing layout in CSS. Or at least stop setting
pixel-valued widths. Do you really want to break your page whenever someone
views it in a window that is, say, 450 pixels wide?

Besides, you didn't give a _real_ example, did you? The phenomenon that you
describe cannot be seen by testing your example.
i need the width of the columns to STAY at 250
No you don't. Analyze why you want that, and you'll find your _real_
problem.
the tag "word-wrap: break-word;" works,
For some odd values of "works", and it's not a tag at all. When it "works",
it brutally breaks words with no indication like hyphens, so it seriously
distorts that.
what can i do to fix this?
Redesigning the site is the fastest way, and realistically the only way.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Sep 28 '06 #2

P: n/a
"momo" <js@js.comwrote:
>say i have the following table:

<table width="500">
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i need the width of the columns to STAY at 250 and wrap text that is longer
instead of blowing apart the whole table.
The table cell width will stay at 250px provided that the cell content
can be wrapped within that width. The cell content (and eventually the
table itself) will stretch if the cell content cannot be wrapped within
the specified width.
>the tag "word-wrap: break-word;" works, but is only supported in IE. what
can i do to fix this?
Font zooming will eventually cause the table to stretch, but it would
take a fair amount of zooming given the provided "content" and cell
width.

It would have been much better if you had provided an url to what you
are actually trying to do instead of posting bogus content and markup.

Btw, this would not be an issue if you had used tables for their
intended purpose instead of using them for layout.

--
Spartanicus
Sep 28 '06 #3

P: n/a
here is an example of what i need to do. i would greatly appreciate it if
someone has a fix

http://www.sixhouse.net/wrap.html

"Spartanicus" <in*****@invalid.invalidwrote in message
news:rc********************************@4ax.com...
"momo" <js@js.comwrote:
>>say i have the following table:

<table width="500">
<tr>
<td width="250">this is the text im concerned with</td>
<td></td>
</tr>
</table>

i need the width of the columns to STAY at 250 and wrap text that is
longer
instead of blowing apart the whole table.

The table cell width will stay at 250px provided that the cell content
can be wrapped within that width. The cell content (and eventually the
table itself) will stretch if the cell content cannot be wrapped within
the specified width.
>>the tag "word-wrap: break-word;" works, but is only supported in IE. what
can i do to fix this?

Font zooming will eventually cause the table to stretch, but it would
take a fair amount of zooming given the provided "content" and cell
width.

It would have been much better if you had provided an url to what you
are actually trying to do instead of posting bogus content and markup.

Btw, this would not be an issue if you had used tables for their
intended purpose instead of using them for layout.

--
Spartanicus

Sep 29 '06 #4

P: n/a
Please do not top post, corrected this once.

"momo" <js@js.comwrote:
>It would have been much better if you had provided an url to what you
are actually trying to do instead of posting bogus content and markup.
>here is an example of what i need to do. i would greatly appreciate it if
someone has a fix

http://www.sixhouse.net/wrap.html
More bogus markup and content, I'm not willing to continue a discussion
on that basis.

--
Spartanicus
Sep 29 '06 #5

P: n/a
Scripsit momo:
here is an example of what i need to do. i would greatly appreciate
it if someone has a fix

http://www.sixhouse.net/wrap.html
Try reading comprehensively some of the answers you got, instead of randomly
quoting comprehensively one of them.

You are not helping us to help you when you don't describe the real problem.
Your content is surely not "this_is_the_text_that_i_need_to_wrap", and if
breaking at random points is a solution, as you seem to think, then you have
an odd problem.

What you need to do is to get rid of the rigid layout and to set up some
processing of the data you get from the database, whether it be truncation
or insertion of spaces or insertion of <wbrtags.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Sep 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.