471,598 Members | 1,162 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

wrap text in a table

258 100+
Hello everyone
as you see below i have a table which contains some text. The text written in this table comes from a database which is sent by users.
My problem is that if some user writes a text without spaces longer than this table then the table will be stretched but i want the text to be wraped instead ( break )
-------------------------
<table width="100" >
<tr>
<td>
The text comes here...
</td>
</tr>
</table>
Sep 17 '07 #1
6 3821
drhowarddrfine
7,435 Expert 4TB
HTML cannot do this.
Sep 17 '07 #2
Soup
5
Hello everyone
as you see below i have a table which contains some text. The text written in this table comes from a database which is sent by users.
My problem is that if some user writes a text without spaces longer than this table then the table will be stretched but i want the text to be wraped instead ( break )
-------------------------
<table width="100" >
<tr>
<td>
The text comes here...
</td>
</tr>
</table>
Actually, try the style WORD-BREAK:BREAK-ALL. The breaking happens even if there is no delimiters in the text.

A little Google search revealed this nugget and it just may work.
Sep 18 '07 #3
Use the style WORD-BREAK:BREAK-ALL; the breaking happens even if there is no delimiters in the text
Sep 19 '07 #4
drhowarddrfine
7,435 Expert 4TB
There is no such thing as "WORD-BREAK" in standard Html.
Sep 20 '07 #5
Soup
5
There is no such thing as "WORD-BREAK" in standard Html.
Who's talking about HTML? This property is defined in CSS3. Therefore it's a style attribute, not an HTML tag.
Sep 20 '07 #6
drhowarddrfine
7,435 Expert 4TB
Yes, I forgot about that. However, I'm not sure how well it is supported cross browser. CSS3 is still in the draft stage but this has been brought up here before. If someone wants to use this, I would search to make sure it is available in all browsers.
Sep 21 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Guru | last post: by
3 posts views Thread by JHR | last post: by
2 posts views Thread by foldface | last post: by
10 posts views Thread by Lorenzo Thurman | last post: by
5 posts views Thread by momo | last post: by
6 posts views Thread by Victor | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

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.