First of all, a correction, only 28 layers are displayed, not 27.
Recursion is used below. You can clearly see that all the table layers you want to create have been created, but when it is displayed, from the 28th layer It just doesn’t show up after that.
As for why it doesn’t show up, I don’t know.
]
<script>
var n = 40;
function createTable(pI){
var oTable = document.createElement("TABLE");
oTable.border = 1;
oTable.width = 1000 - pI;
oTable.height = 1000 - pI;
var oTBody = document.createElement("TBODY");
var oTr = document.createElement("TR");
var oTd = document.createElement("TD");
oTd.innerHTML = pI;
if(pI<n)
oTd.appendChild(createTable(pI+1));
oTr.appendChild(oTd);
oTBody.appendChild(oTr);
oTable.appendChild(oTBody);
document.body.appendChild(oTable);
alert(pI)
return oTable;
}
createTable(1);
</script>