Introduction
PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following example.
<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <table width="300px" cellspacing="0px" cellpadding="0px" border="1px"> <?php for($row=1;$row<=8;$row++) { echo "<tr>"; for($col=1;$col<=8;$col++) { $total=$row+$col; if($total%2==0) { echo "<td height=30px width=30px bgcolor=white></td>"; } else { echo "<td height=30px width=30px bgcolor=black></td>"; } } echo "</tr>"; } ?> </table> </body> </html>