自動流し込みがイマイチわかりませんが普通にテーブル書くだけではいけないのでしょうか?
CSS
1table{border-collapse:collapse;}
2table,tr,td,th{border:3px solid;border-Color:#ffffff;}
3th#hidariue{background-Color:inherit;}
4th{background-Color:#808080;width:30px;height:30px;text-align:center;}
5td{background-Color:#c0c0c0;width:30px;height:30px;text-align:center;}
PHP
1$w=10;
2$h=8;
3$table="";
4for($i=0;$i<$h;$i++){
5 if($i==0){
6 $table.="<tr><th id='hidariue'> </th>";
7 for($j=0;$j<$w;$j++){
8 $table.="<th> </th>";
9 }
10 $table.="</tr>";
11 }
12 $table.="<tr>";
13 for($j=0;$j<$w;$j++){
14 if($j==0) $table.="<th> </th>";
15 $table.="<td><input type='checkbox' checked></td>";
16 }
17 $table.="</tr>";
18}
19if($table!=="") $table="<table>".$table."</table>";
20print $table;