<
button onclick="myFunction()">Try it<
/button>
< script>
var matrice=[
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[2,2,1,1,1,1,1,1,2,2,2,2,2,2,2,2],
[2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],
];
function myFunction() {
x = document.getElementById("demo")
for(i=0;i< matrice[0].length;i++)
{
for(j=0;j< matrice[1].length;j++)
{
x.innerHTML = x.innerHTML + matrice[i][j];
}
x.innerHTML = x.innerHTML+"< br>";
}
}
<
/script>