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 7 of 7
  1. #1
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts

    making "word-break" work in FireFox

    Code:
    <style>
    td {word-break:break-all}
    </style>
    
    <table>
    <tr>
    <td width='200'>123456789012345678901234567890123456789012345678901234567890</td>
    </tr>
    </table>
    When the width of the number-print exceeds '200px,'
    The following numbers are shown in the next line in IE6.

    But This word-break doesn't work in FireFox.

    Can I make it work in FireFox by your help?
    Get my greedy up

  • #2
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    I don't think word-break:break-all is supported by Firefox, so it'll only work in IE. I don't know of an equivilant for Firefox.

  • #3
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by weazel
    I don't think word-break:break-all is supported by Firefox, so it'll only work in IE. I don't know of an equivilant for Firefox.
    Anyone who knows an equivilant for FireFox?
    Get my greedy up

  • #4
    Regular Coder
    Join Date
    Apr 2003
    Location
    Seoul, Korea
    Posts
    329
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Any solution for word-breaks for FireFox?
    Get my greedy up

  • #5
    Senior Coder JamieR's Avatar
    Join Date
    Oct 2004
    Location
    United Kingdom
    Posts
    3,161
    Thanks
    0
    Thanked 5 Times in 5 Posts
    As far as I know, there isn't one.

  • #6
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    When the width of the number-print exceeds '200px,'
    Sounds like you may be using a server side language to output looooong numbers?

    Try a post in the appropriate forum. If perl, then I think there may be a solution. I can't write it but it would be along these lines,

    if ($variable > 25) {<br />;
    }

    were that proper code, it would insert a line break after a group of 25 numbers.

    Hope this helps,

    Bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link

  • #7
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    use wbr. at least it will work

    Quote Originally Posted by weazel View Post
    As far as I know, there isn't one.
    <html>
    <head>
    <script language='javascript'>
    //<![CDATA[
    window.util = new Object();
    window.util.wrap = function(e,v){
    if(( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) )){
    e.style.wordBreak = "break-all";
    e.innerHTML = v;
    }else{
    e.innerHTML = v.split('').join('<wbr/>');
    }
    };
    window.util.keyCode = function(e){
    return e.which || e.keyCode;
    };
    window.util.element = function(e){
    return e.target || e.srcElement;
    };
    function input_onkeyup(event){

    if(window.util.keyCode(event)!=13)
    return true;
    var table = document.getElementById('table');
    var tr = table.insertRow(0);
    var td = tr.insertCell(0);

    window.util.wrap(td,window.util.element(event).value);
    }
    //]]>
    </script>
    </head>
    <body>
    Input : <input onkeyup='return input_onkeyup(event)' size='80'>
    Input text and hit enter.
    <table id='table' width='300px' border='1'>
    </table>
    </body>
    </html>


  •  

    Posting Permissions

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