<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body></body>
</html>
<script>
const a=16;
x='X'
for(let i=0;i<a;i++){
let m=[...Array(a)]
if (!(i%(a-1))){m=m.map(()=>x)}
else {m[0]=m[a-1]=m[i]=m[a-1-i]=x}
document.write('<pre>',...m.map(item=>item===x?item:' ').join(' '),'</pre>')
}
</script>