Professional Web Applications Themes

Word Wrap - ASP.NET

I've a DG and I've set all rows with WordWrap=false but when the cell text is something like "Hello brave new world" the text wrap (for the white space?). How can i disable the wrap for everything ? thanks Paps...

  1. #1

    Default Word Wrap

    I've a DG and I've set all rows with WordWrap=false but when the cell text
    is something like "Hello brave new world" the text wrap (for the white
    space?).
    How can i disable the wrap for everything ?

    thanks Paps


    Paps Guest

  2. #2

    Default Re: Word Wrap

    Hi

    Setting WordWrap = false for Row does not server any purpose. you need
    to set it for each and every col.

    eg.

    This will wrap the text in TD
    <HTML>
    <body>
    <table width=100>
    <tr nowrap>
    <td >welcome to C# welcome to C# welcome to C# welcome to C#
    welcome to C#</td>
    </tr>
    </table>
    </body>
    </HTML>

    This wont
    <HTML>
    <body>
    <table width=100>
    <tr >
    <td nowrap>welcome to C# welcome to C# welcome to C# welcome
    to C# welcome to C#</td>
    </tr>
    </table>
    </body>
    </HTML>


    HTH
    Prasad

    "Paps" <papettipeuroforex.com> wrote in message
    news:#NS#DLwRDHA.1552TK2MSFTNGP12.phx.gbl...
    > I've a DG and I've set all rows with WordWrap=false but when the cell text
    > is something like "Hello brave new world" the text wrap (for the white
    > space?).
    > How can i disable the wrap for everything ?
    >
    > thanks Paps
    >
    >

    Prasad Guest

  3. #3

    Default Re: Word Wrap


    I had the same problem but couldn't find a solution. I ended up replacing
    each space with &nbsp;

    Hello&nbsp;brave&nbsp;new&nbsp;world

    "Paps" <papettipeuroforex.com> wrote in message
    news:%23NS%23DLwRDHA.1552TK2MSFTNGP12.phx.gbl...
    > I've a DG and I've set all rows with WordWrap=false but when the cell text
    > is something like "Hello brave new world" the text wrap (for the white
    > space?).
    > How can i disable the wrap for everything ?
    >
    > thanks Paps
    >
    >

    Oleg Ogurok Guest

  4. #4

    Default word wrap

    I want to display a string in a table but when a word in the string is
    longer then 40 letters it won't wrap. Does anyone know how I can fix this ?

    Thanx

    Wannes


    news.pandora.be Guest

  5. #5

    Default Re: word wrap

    where would you expect it to wrap? if it's a single, uninterrupted, string
    of characters the browser has no idea where to break it, besides it's not
    right to break it most likely. You'll have to build a custom string reader
    to insert a "<br>" or linebreak (if displayed in a textbox, etc).

    --
    Curt Christianson
    Owner/Lead Developer, DF-Software
    Site: [url]http://www.Darkfalz.com[/url]
    Blog: [url]http://blog.Darkfalz.com[/url]


    "news.pandora.be" <nono.com> wrote in message
    news:ed7qc.113060$f83.6457443phobos.telenet-ops.be...
    > I want to display a string in a table but when a word in the string is
    > longer then 40 letters it won't wrap. Does anyone know how I can fix this
    ?
    >
    > Thanx
    >
    > Wannes
    >
    >

    Curt_C [MVP] Guest

  6. #6

    Default Re: word wrap

    And how would I have te do that ?

    "Curt_C [MVP]" <software_AT_darkfalz.com> schreef in bericht
    news:eGMCDrDPEHA.3476TK2MSFTNGP09.phx.gbl...
    > where would you expect it to wrap? if it's a single, uninterrupted, string
    > of characters the browser has no idea where to break it, besides it's not
    > right to break it most likely. You'll have to build a custom string reader
    > to insert a "<br>" or linebreak (if displayed in a textbox, etc).
    >
    > --
    > Curt Christianson
    > Owner/Lead Developer, DF-Software
    > Site: [url]http://www.Darkfalz.com[/url]
    > Blog: [url]http://blog.Darkfalz.com[/url]
    >
    >
    > "news.pandora.be" <nono.com> wrote in message
    > news:ed7qc.113060$f83.6457443phobos.telenet-ops.be...
    > > I want to display a string in a table but when a word in the string is
    > > longer then 40 letters it won't wrap. Does anyone know how I can fix
    this
    > ?
    > >
    > > Thanx
    > >
    > > Wannes
    > >
    > >
    >
    >

    news.pandora.be Guest

  7. #7

    Default Re: word wrap

    What kind of word is longer than 40 letters? Where would it make sense to
    break up such a word? Exactly in half, after 20 characters, after 32
    characters, 5 characters from the end, ...?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]





    "news.pandora.be" <nono.com> wrote in message
    news:ed7qc.113060$f83.6457443phobos.telenet-ops.be...
    >I want to display a string in a table but when a word in the string is
    > longer then 40 letters it won't wrap. Does anyone know how I can fix this
    > ?
    >
    > Thanx
    >
    > Wannes
    >
    >

    Aaron Bertrand [MVP] Guest

  8. #8

    Default Re: word wrap

    It's in a sort of message board so I cant realy controle what will be
    displayed in the table.
    I have to make shure that if someone has put in such long words my table
    will still be displayed as it should.
    Therefor I'm looking for an ASP-code that places an "<BR>" into my string if
    there are words longer than 40 letters in it. It doesn't realy matter to me
    where the words are broken as long as they are.

    gr.

    Wannes

    "Aaron Bertrand [MVP]" <aaronTRASHaspfaq.com> schreef in bericht
    news:O6j8V1DPEHA.1048tk2msftngp13.phx.gbl...
    > What kind of word is longer than 40 letters? Where would it make sense to
    > break up such a word? Exactly in half, after 20 characters, after 32
    > characters, 5 characters from the end, ...?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > [url]http://www.aspfaq.com/[/url]
    >
    >
    >
    >
    >
    > "news.pandora.be" <nono.com> wrote in message
    > news:ed7qc.113060$f83.6457443phobos.telenet-ops.be...
    > >I want to display a string in a table but when a word in the string is
    > > longer then 40 letters it won't wrap. Does anyone know how I can fix
    this
    > > ?
    > >
    > > Thanx
    > >
    > > Wannes
    > >
    > >
    >
    >

    news.pandora.be Guest

  9. #9

    Default Re: word wrap

    I would do something like this when you STORE the data (then you don't have
    to do it every time you display it).

    data = request.form("data")
    datas = split(data, " ")
    for i = 0 to ubound(datas)
    if len(datas(i))>40 then
    tmp = ""
    for i = 1 to len(datas(i)) step 40
    tmp = tmp & "<br>" & mid(str, i, 40)
    next
    datas(i) = tmp
    end if
    next
    data = join(datas, " ")
    ' now replace single apostrophes with two, insert into db, etc.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]





    "news.pandora.be" <nono.com> wrote in message
    news:SJ7qc.113124$Ug7.6291513phobos.telenet-ops.be...
    > It's in a sort of message board so I cant realy controle what will be
    > displayed in the table.
    > I have to make shure that if someone has put in such long words my table
    > will still be displayed as it should.
    > Therefor I'm looking for an ASP-code that places an "<BR>" into my string
    > if
    > there are words longer than 40 letters in it. It doesn't realy matter to
    > me
    > where the words are broken as long as they are.
    >
    > gr.
    >
    > Wannes
    >
    > "Aaron Bertrand [MVP]" <aaronTRASHaspfaq.com> schreef in bericht
    > news:O6j8V1DPEHA.1048tk2msftngp13.phx.gbl...
    >> What kind of word is longer than 40 letters? Where would it make sense
    >> to
    >> break up such a word? Exactly in half, after 20 characters, after 32
    >> characters, 5 characters from the end, ...?
    >>
    >> --
    >> Aaron Bertrand
    >> SQL Server MVP
    >> [url]http://www.aspfaq.com/[/url]
    >>
    >>
    >>
    >>
    >>
    >> "news.pandora.be" <nono.com> wrote in message
    >> news:ed7qc.113060$f83.6457443phobos.telenet-ops.be...
    >> >I want to display a string in a table but when a word in the string is
    >> > longer then 40 letters it won't wrap. Does anyone know how I can fix
    > this
    >> > ?
    >> >
    >> > Thanx
    >> >
    >> > Wannes
    >> >
    >> >
    >>
    >>
    >
    >

    Aaron Bertrand [MVP] Guest

  10. #10

    Default Re: word wrap

    > tmp = tmp & "<br>" & mid(str, i, 40)

    OOPS! Change str to datas(i) here.


    Aaron Bertrand [MVP] Guest

  11. #11

    Default Re: word wrap

    news.pandora.be wrote on 17 mei 2004 in
    microsoft.public.inetserver.asp.general:
    > It's in a sort of message board so I cant realy controle what will be
    > displayed in the table.
    > I have to make shure that if someone has put in such long words my
    > table will still be displayed as it should.
    > Therefor I'm looking for an ASP-code that places an "<BR>" into my
    > string if there are words longer than 40 letters in it. It doesn't
    > realy matter to me where the words are broken as long as they are.
    >
    this simple j(ava)script script breaks all words
    longer than 40 chars long into 40 char parts
    ended by a - and a space:

    t = t.replace(/(\S{40})/g,"$1- ")


    ======================

    same in vbscript [longer]:

    Set regEx = New RegExp
    regEx.Pattern = "(\S{40})"
    regEx.Global = True
    t = regEx.Replace(t, "$1- ")




    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  12. #12

    Default Re: Word Wrap

    This Worked for me....The content of the cell 1 & 5 were company name which may be comes like "Fire Safety International Ltd" and the Column Header is Just "Name"....So in my grid view it Appeared like
    Name
    ---------
    Fire Safety
    International Ltd

    Which i dont want...
    All i want is
    Name
    -------
    Fire Safety International Ltd

    Below code gave me wat i want!!!....

    protected void gdvCPReport_RowCreated(Object sender, GridViewRowEventArgs e)
    {
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
    TableCell tc = new TableCell();
    tc = e.Row.Cells[1];
    tc.Style.Add(HtmlTextWriterStyle.WhiteSpace, "nowrap");

    TableCell tcr = new TableCell();
    tcr = e.Row.Cells[5];
    tcr.Style.Add(HtmlTextWriterStyle.WhiteSpace, "nowrap");
    }
    Unregistered Guest

Similar Threads

  1. How do you word wrap a TextInput Label?
    By flatpickinJohn in forum Macromedia Flex General Discussion
    Replies: 3
    Last Post: April 25th, 02:00 AM
  2. help with a tabel word wrap
    By 8 in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: October 24th, 10:28 AM
  3. Word Wrap - Two Line Label
    By allen@oysterweb.com in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: October 7th, 10:08 PM
  4. Default path word wrap.
    By mojo_texas@adobeforums.com in forum Adobe Indesign Windows
    Replies: 6
    Last Post: June 22nd, 09:05 PM
  5. Dynamic text word wrap?
    By jums19 webforumsuser@macromedia.com in forum Adobe Flash, Flex & Director
    Replies: 2
    Last Post: October 7th, 04:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139