Write a HTML code for 2×2 Table and fill different color in each cell.


Q1. Write a HTML code for 2×2 Table and fill different color in each cell.

Answer:-

<!DOCTYPE html>
<html>

<head>
 <Example of table cell>
</head>

<body>

<Table border="1" border color="brown">
<Tr>
<Td width="20" bgcolor="red">&nbsp;&nbsp;</td>
<Td width="20" bgcolor="green">&nbsp;&nbsp;</td>
</Tr>
<Tr>
<Td width="20" bgcolor="blue">&nbsp;&nbsp;</td>
<Td width="20" bgcolor="yellow">&nbsp;&nbsp;</td>
</Tr>
</Table>
</body>

</html>

Output




No comments:

Post a Comment