Skip to content

Instantly share code, notes, and snippets.

@kodi
Created September 15, 2009 21:26
Show Gist options
  • Save kodi/187658 to your computer and use it in GitHub Desktop.
Save kodi/187658 to your computer and use it in GitHub Desktop.
<html>
<head>
<style type="text/css">
table{
border-collapse:collapse;
}
table td{
border:solid 1px #cacaca;
}
</style>
<script type="text/javascript">
function generateTable(rows,columns,container){
var HTML='<table>';
for(var i=0;i<rows;i++){
HTML+='<tr>';
for(var j=0;j<columns;j++){
HTML+='<td>Colum: '+j+' Row:'+i+' </td>';
}
HTML+='<tr>';
}
HTML+='</table>';
document.getElementById(container).innerHTML=HTML;
}
window.onload=function(){
generateTable(4,4,'result');
}
</script>
</head>
<body>
<div id="result"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment