iGuest 3 Report post Posted February 22, 2008 how wrap the text content inside the div tag? Word Wrap Text In Div. Sir I developed a site for company.The contents are displayed dynamically. With the help of Ajax.Here the contet are from Databse and placed inside "div tag". Which are inside the "table". The content stored in the DB is in html format. So the problem is SOME TIMES IF THE CONTENT'S(table ) WIDTH IS GREATER THAN THE SPECIFIED SIZE OF THE table(USER SIDE) THEN THE ALIGNMENT FULLY CHANGED. THE CONTENT FROM THE DTATABASE COULD NOT OCCUPY THE SPECIFIED SPACE IN DISPLAY SIDE(user side). THE CONTENT COULD NOT WRAP and CANT PACED INSIDE THE TABLE. Please help me how to wrap the content inside the table. <td width="600" height="400px" bgcolor="#FFFFFF" colspan="2" > <div id="txtHint" style="width:595; vertical-align:top ;" > //CONTENT FROM DB //AJAX TECHNOLOGY USED, the content paced in <div> </div></td> Plese help me Saami Share this post Link to post Share on other sites
iGuest 3 Report post Posted September 2, 2008 text should be fixed inside div Word Wrap Text In Div. I need the text to be fit inside the div.Ie if I'm giving a long text the div should not expand and the words should fit inside and when I'm taking the mouse over the full text should be visible -reply by ruby Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 28, 2009 years too late, but this helped me... If anyone reads this use overflow:hidden in your div Share this post Link to post Share on other sites
iGuest 3 Report post Posted May 13, 2009 I solved it this way using divsWord Wrap Text In Div.Hi, I had the same problem. I used php wordwrap() fucntion to plain text which worked just fine. But only until I had to convert my plain text fields to html fields. So, what I did was eliminated all fancy php functions and wrap my test displaying area on my page with a <div style="width:400px; white-space:normal"> [text display area]</div>. Thats it. It worked just fine. -reply by Sanjaya Share this post Link to post Share on other sites
iGuest 3 Report post Posted December 22, 2009 white-space:normal; WORKED! I had the same issue in Firefox 3.5.6, where text would not wrap inside a <div> tag. I even had "overflow: auto;" set. That only worked in IE7. <div style='white-space: normal;'> did the trick. Thanks a bunch! Share this post Link to post Share on other sites
iGuest 3 Report post Posted April 22, 2010 This is a no-brainer, hereWord Wrap Text In Div.Hell yeah, that is a big one. See, when a word is too long, like bbbbbbbbbbbbbbbbbbbb.. (and on and on) it WILL get ugly and stretch to the right. But here's the solution: just put { word-wrap: break-word } in your CSS! and it works ok.-reply by Constantine Share this post Link to post Share on other sites
iGuest 3 Report post Posted November 22, 2010 Just tried white-space:normal; It WORKED!!! Thank you so much!!! Share this post Link to post Share on other sites
iGuest 3 Report post Posted March 24, 2011 i have table rows dynamically added..the text in the table cell comes from a xml file and due to the length of the text (its a URL) it stretches the width of the cell and spoils the display. I tried defining the cell style in css with the white-space:normal as previously said by someone. But it does not work here Can anyone help? Share this post Link to post Share on other sites
iGuest 3 Report post Posted September 16, 2011 white-space: pre; /* CSS 2.0 */white-space: pre-wrap; /* CSS 2.1 */white-space: pre-line; /* CSS 3.0 */white-space: -pre-wrap; /* Opera 4-6 */white-space: -o-pre-wrap; /* Opera 7 */white-space: -moz-pre-wrap; /* Mozilla */white-space: -hp-pre-wrap; /* HP Printers */word-wrap: break-word; /* IE 5+ */ Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 11, 2011 I think all that is necessary is.. text-align:justify; or wrap paragraph tags around the text Share this post Link to post Share on other sites