Table Create In html
Tags are given below those are use to create table in html.
Tag
|
Description
|
<table> |
Use to Defines a table
|
<th> |
Use to Defines a header cell in a
table
|
<tr> |
Use to Defines a row in a table
|
<td> |
Use to Defines a cell in a table
|
<caption> |
Use to Defines a table caption
|
<thead> |
Use to Groups the header content
in a table
|
<tbody> |
Use to Groups the body content in
a table
|
<tfoot> |
Use to Groups the footer content
in a table
|
Example:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Table</title>
</head>
<body>
<table>
<tr>
<td>Row 1 Col 1</td>
<td>Row 1 Col 2</td>
<td>Row 1 Col 3</td>
</tr>
<tr>
<td>Row 2 col 1</td>
<td>Row 2 col 2</td>
<td>Row 2 col 3</td>
</tr>
<tr>
<td>Row 3 col 1</td>
<td>Row 3 col 2</td>
<td>Row 3 col 3</td>
</tr>
</table>
</body>
</html>
Output:
but it's little bit difficult to understood because there is no border between row and column but we use border attribute,we see a change .Use border attribute in table tag .Like example given below
<table border="1">
Output: |
Note: for create a table first define <table> tag the use <tr> tag to make row in the table.Then use <td> in <tr> tag to divide row in the column. |
|||||||||||||||||||||||||||||||
Tag: Table Create In html,<table> tag, <tr> tag, <td> tag. |
|||||||||||||||||||||||||||||||
No comments:
Post a Comment