I have used this javascript function:
$(document).ready(function(){
$("td").each(function() {
if (parseInt($(this).text()) > 0) {
$(this).css("text-align", "right");
}
});
});
By this all the numbers are right aligned. But I want that the string entered should be left aligned. I think that by using NaN it is possible but I don’t know how to use it. Can some one tell me the way to use NaN or some other function?
Why can’t you use the
typeofoperator to determine between number and string.Hope it helps.