Saturday, January 9, 2010

Code for word wrap for a row in table

script type="text/javascript"



// Needed for IE 7+ and Firefox.

function windowOnLoad()

{

// If Internet Explorer less than version 7...

if ( navigator.appName.indexOf('Microsoft') != -1 )

{

var versionValue = new String(navigator.appVersion);

var msieIndex = versionValue.indexOf('MSIE');



if ( msieIndex >= 0 )

{

versionValue = versionValue.substr(msieIndex, versionValue.length-msieIndex);

versionValue = versionValue.replace('MSIE ', '');

}



if ( parseInt(versionValue) < spantagarray =" document.getElementsByTagName('span');" i="0;" if="" classname="=" wordwrap="" var="" spantext="spanTagArray[i].innerHTML;" innerhtml="spanText.replace(/(.*?)/g,">');

}

}

}



window.onload = windowOnLoad;



/script

No comments: