How to make Tables in HTML

In this article we will discuss about the table in the HTML.
  • 1861

Table is the collection of the rows and columns. It is possible to create the table in HTML. It is used to show the data at one place. In HTML table is created using <table>.......</table>.

HTML code:

<html>
<head>
    <title></title>
</head>
<body>
   <table border="1" cellpadding="4" cellspacing="4" width="70%">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td width="20%">Table cell 1</td>
<td>Table cell 2</td>
</tr>

<  </table>
</body>
</html>

Output

Name Age
Table cell 1 Table cell 2

Here the cell padding tag is used to create space between the text inside your table and the border surrounding that text. The cell spacing tag is to create space between different cells within your table. These are the attributes of the table.

Here <th> tag stands for table header. In it table heading comes in bold letter and also in centralized form. Here Name and Age are coming in bold form. Here width property indicates the width of the table.

Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.