Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2004, 08:20 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default wrapping text

Hi All,
     I have a problem. If use enters word of size 40 charcters more than that while displyaing it is distrbing table structure. I want to wrap the text and get into the next line. Here I am using "wrap=hard" attrubute. Even then That is not getting to the 2nd line. I know that there will be no word of size of 40 or more. But testers will try for that. I want a quick solution for that.
Thanks
Suresh

 
Old September 24th, 2004, 05:27 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

I would say, you use width attribute to achieve that. Table element support just NOWRAP attribute, which is boolean and if present, doesn't wrap the text, if absent it wraps the text within the cell for a given width. So it is all to do with WIDTH attribute and omit the WRAP related attribute there.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 25th, 2004, 02:55 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi Vijay,
    Even i assign width = 30%, If That text entered is more than that it is crossing that limit of 30% and it is going beyond the screen and a scroll bar is appear at the bottom of the page.
Any Help..
Thanks
Suresh

 
Old September 25th, 2004, 08:45 AM
Authorized User
 
Join Date: Apr 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default

do not put any attribute for warp. The table will automatically warp it. i.e

<td> // no attribute for warp
  this is the 40 character text
  </td>

From
Burhan


 
Old September 25th, 2004, 10:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Suresh, you will have to set the width for all the <TD>s there. All together should sum up to 100%. If not specified width for the other <TD>s within this <table>, then for any lengthy line this would adjust with the width of the other TDs. Another way(reliable) is to specify width in pixels, though that is not recommended as works fine for a fixed resolution.

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old September 28th, 2004, 06:42 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi all,
     Even i gave width attribute all the columns and sum of all is equal to 100%, if i give a text of length 40 characters with out space it is not getting wrapped. That you can test on your system also. Even i dont use width attribute the same thing happening.
Any more ideas..
Thanks
Suresh

 
Old September 28th, 2004, 06:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

try adding the CSS style "word-wrap: break-word;" to the TD. This only works, though, if you have a fixed width setting (e.g. pixels) not a % setting.

This is really a problem for the CSS or HTML forums.
 
Old September 28th, 2004, 07:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

sorry, just noticed that word-wrap is a microsoft only css extension, only works on IE5.5+





Similar Threads
Thread Thread Starter Forum Replies Last Post
Text wrapping abhilasha_dubey JSP Basics 1 October 26th, 2007 12:03 AM
text wrapping and controls clinging to left of pag cathiec Visual Studio 2005 0 August 10th, 2005 11:19 AM
"Text-wrapping" bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 28th, 2005 11:53 PM
Text Wrapping within a Table spraveens HTML Code Clinic 1 March 15th, 2004 05:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.