Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Dec 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    - sign wraps the text .....

    Below is the HTML written for a sample table(one row) with some CSS, and I'm observing a strange brhavior atleast it is to me, here is that HTML



    <table class=cDGrd id=tbleExposure
    style="table-layout:fixed; WIDTH: 979px; overflow: scroll;" border=1>


    <tr HEIGHT=25>
    <td STYLE="WIDTH: 10px; white-space: nowrap;">030001</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">2444</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">-1111111144,783,156.94</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">77,777,975.10</td>
    <td STYLE="WIDTH: 150px; white-space: nowrap;">1122,561,132.04</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">133,276,503.70</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">53,403,919.06</td>
    <td STYLE="WIDTH: 149px; white-space: nowrap;">186,680,422.76</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">Sell</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">0</td>
    <td STYLE="WIDTH: 100px; white-space: nowrap;">Sell Status</td>
    </tr>

    </table>

    this works fine but the strange thing is that for example if I add a '-' sign before this value '1111111144,783,156.94' then contents r wrapped into '-' and '1111111144,783,156.94' and as I've fixed the td hieght to '25px' so I could only see the '-' sign, adding anything other than '-' like + or * or any aphabet or number works as intended.

    so can any 1 help me out that what is missing in it?

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    This only happens in IE. IE must decide that that is a good place to wrap the text (Between the sign and the #)

    Anyhow, what's the point of putting data in a table that isn't big enough to hold it?

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #3
    New Coder
    Join Date
    Dec 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes Whizard thats right there is no point in it but the real issue is that why IE is treating only '-' sign differently, it works absolutely fine with *,+,#,$ with fine I mean it doesn't wraps it.

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    It’s probably just another one of Internet Explorer’s infinite bugs. Using white-space: pre seems to take care of the problem.

    That document could also use less inline CSS:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      <head>
    
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="Author" content="Patrick Garies"/>
        <title>XHTML 1 Strict Document</title>
    
        <style type="text/css">
          table {
            width: 979px;
            border: 1px outset;
            table-layout: fixed;
            }
          td {
            height: 25px;
            border: 1px inset;
            white-space: pre;
            }
          col {
            width: 10px;
            }
          col[span] {
            width: 100px;
            }
          col[span="3"] + col {
            width: 150px;
            }
          col[span="2"] + col {
            width: 149px;
            }
        </style>
    
      </head>
      <body>
    
        <table id="tbleExposure" class="cDGrd">
          <col/>
          <col span="3"/>
          <col/>
          <col span="2"/>
          <col/>
          <col span="3"/>
          <tr>
            <td>030001</td>
            <td>2444</td>
            <td>−1111111144,783,156.94</td>
            <td>77,777,975.10</td>
            <td>1122,561,132.04</td>
            <td>133,276,503.70</td>
            <td>53,403,919.06</td>
            <td>186,680,422.76</td>
            <td>Sell</td>
            <td>0</td>
            <td>Sell Status</td>
          </tr>
        </table>
    
      </body>
    </html>
    Last edited by Arbitrator; 12-16-2006 at 09:11 PM. Reason: Changed hyphen‐minus character to the minus character.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    It probably thinks '-' is a hyphen, so it wraps the text there

    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Well, now that I think about it, the issue could be avoided altogether if you used the a more specific character (a minus sign) for the negative sign instead of the the hyphen‐minus character. Internet Explorer doesn’t seem to wrap the text when the minus sign (−) is used; you can type it directly or encode it as &minus; or &#x2212;.
    Last edited by Arbitrator; 12-16-2006 at 09:10 PM. Reason: Added named character entity and altered phrasing.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #7
    New Coder
    Join Date
    Dec 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up



    IE sucks

  • #8
    New Coder
    Join Date
    Dec 2006
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts
    by the way is their any css thing that prevent IE from wrapping the text altogether irrespective of the contents like '-'

  • #9
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    I mentioned how to do that in post four
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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