...

View Full Version : making "word-break" work in FireFox



joonstar
08-16-2005, 04:28 AM
<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?

JamieR
08-16-2005, 09:06 AM
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.

joonstar
08-16-2005, 12:44 PM
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?

joonstar
09-09-2005, 12:16 PM
Any solution for word-breaks for FireFox?

JamieR
09-09-2005, 02:23 PM
As far as I know, there isn't one.

bazz
09-09-2005, 04:39 PM
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

micron98
09-02-2008, 02:01 PM
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>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum