Как вариант:
<style type="text/css">
td {border: 1px black solid;}
</style>
<script type="text/javascript">
window.onload = function () {
var container = document.getElementById('container');
//Create TABLE
var tagTable = document.createElement('TABLE');
var attributetagTable = tagTable.setAttribute('class', 'table');
var table = container.appendChild(tagTable);
for (i = 0; i < 7; i++) {
//Create TR
var tagTr = document.createElement('TR');
tagTr.setAttribute('class', 'tr');
tagTable.appendChild(tagTr);
//Create TD
for (j = 0; j < 7; j++) {
var tagTd = document.createElement('TD');
tagTd.setAttribute('class', 'td');
tagTd.innerHTML = j;
tagTr.appendChild(tagTd);
}
}
}
</script>
<div id="container"></div>