<script type="text/javascript">
function myfunction(counter) {
var a=document.getElementById("tbl");
if ( a.hasChildNodes() ){
while ( a.childNodes.length >= 1 )
{
a.removeChild( a.firstChild );
}
}
var row1=document.createElement("TR");
a.appendChild(row1);
var col4=document.createElement("TD");
row1.appendChild(col4);
col4.setAttribute("class","heading");
$(".heading").html("cidMember");
var col5=document.createElement("TD");
row1.appendChild(col5);
col5.setAttribute("class","heading1");
$(".heading1").html("select");
for (var i=1;i<=counter;i++) {
var num = i;
var num = num < 10 ? "0"+num : num;
var row=document.createElement("TR");
a.appendChild(row);
var col1=document.createElement("TD");
row.appendChild(col1);
col1.setAttribute("class","column"+i);
$(".column"+i).html("<?php echo $_GET[cid]?>"+num);
var col2=document.createElement("TD");
row.appendChild(col2);
col2.setAttribute("class","colmn"+i);
$(".colmn"+i).html('<input type="checkbox" value="<?php echo $_GET[cid]?>'+num+'" name="check'+i+'" checked>');
}
}
HTML
<font size="+1">how many checkbox you want</font>
<select id="exten" onchange="myfunction(this.value)">
<?php
for ($i = 1; $i <26; $i++) {
$num = $i;
$num = $num < 10 ? "0$num" : $num;
?>
<option value="<?php echo $num;?>"><?php echo $num;?></option>
<?php } ?>
</select>