How to create a simple HTML Table

Wednesday, May 27, 2009 · Posted in

In this article we will know how to create a simple table in HTML without using any CSS but HTML tag attribute only. Try to observe the given code below and its output and then try it. If you experience some bugs or error in executing the codes, send me message through comments for me to be able to fix the program and sample below. Thank you.

HTML Code:

<html>
<head><title>Your title goes here</title></head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="50" align="center">OTY.</td>
<td width="150" align="center">Description</td>
<td width="100" align="center">Unit Price</td>
<td width="100" align="center">Total</td>
</tr>
<tr>
<td width="50" align="center">3</td>
<td width="150" align="center">Noodles</td>
<td width="100" align="center">15.00</td>
<td width="100" align="center">45.00</td>
</tr>
<tr>
<td width="50" align="center">10</td>
<td width="150" align="center">Ballpen</td>
<td width="100" align="center">8</td>
<td width="100" align="center">80</td>
</tr>
</table>
</body>
</html>

Sample Output:

Powered by Blogger.