Highteckgirl

How to create Chess board using PHP

How to create Chess board using PHP

First of all create a file index.php then copy this given code and you can see this chess board.

<table   width="400px" height="400px" cellspacing="0px" cellpadding="0px" border="1px" padding="50px">
<?php
for($row=1;$row<=8;$row++)
{
	echo "<tr>";
	for($column=1;$column<=8;$column++)
	{
		$total=$row+$column;
		if($total%2==0)
		{
			echo "<td height=35px width=30px bgcolor=#FFFFFF></td>";
		}
		else
		{
			echo "<td height=35px width=30px bgcolor=#000000></td>";
		}
	}
	echo "</tr>";
}
?>
</table>

Leave a Reply

Your email address will not be published. Required fields are marked *

X
chat with us
1
HighteckGirl
Hello, How can we help you?