Tem essa função que cria uma pirâme de numeros, porem ela não imprime todas as linhas quando a quantidade é impar.
<script language="javascript">
<!--
function piramede(){
var linha = document.frm.numeroD.value;
var sPir = "";
var cont=1;
for(i=1; i<=parseInt(linha); i++){
if(cont!=linha){
for(j=1; j<=cont; j++){
sPir = sPir + "<font color='gren' size='2'>"+ parseInt(j) +"</font>";
}
cont = cont+2;
}
sPir = sPir + "<br>";
}
document.getElementById("result").innerHTML = sPir;
return false;
}
//-->
</script>