1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[...]</title>
<style type="text/css">
table {
border : 1px solid #e0e0e0;
empty-cells : show;
}
td {
border : 1px solid #e0e0e0;
}
</style>
<script type="text/javascript">
function createLigne( id){
var oRow, oCel, oTxt, oParent = document.getElementById( id);
if( oParent){
for( var lig = 0; lig < 3; lig++){
oRow = oParent.insertRow(-1);
for( var col = 0; col < 3; col++){
oCel = oRow.insertCell(-1);
oTxt = document.createTextNode( (oRow.rowIndex +1) +'-' + (oCel.cellIndex +1));
oCel.appendChild( oTxt);
}
}
}
}
</script>
</head>
<body>
<button onclick = "createLigne( 'ma_table');">Ajouter</button>
<table id="ma_table">
</table>
</body>
</html> |
Partager