Html Table

Google Advertisements

Prev Tutorial Next Tutorial

Table in HTML

Using table we arrange data in the form of row and column. To create a table in html use <table> tag. Complete table are design by using below tags.

  • Table are divided into table row using <tr> tag.
  • Table row are again dived into table data using <td> tag.
  • Table row also divede into table heading using <th> tag.
html table

Note: A table not contain only text but it contain image, video and another table inside table.

Attribute of table

  • border : This attribute used for give border around table and border for all cell.
  • colspan : This attribute defines the number of columns. It is used inside <td> tag.
  • rowspan : This attribute defines the number of row. It is used inside <td> tag.
  • id : This attribute are used for provide unique id for table

HTML Table Tags

TagDescription
1<table>It define table
2<tr>It define a table row in table
3<td>It define table data in table row
4<th>It defined table heading in table row
5<caption>It defined table caption
6<colgroup>It defined It specifies a group of one or more columns in a table for formatting.
7<col>It is used with <colgroup> element to specify column properties for each column.
8<tbody>It is used to group the body content in a table
9<thead>It is used to group the header content in a table
10<tfooter>It is used to group the footer content in a table

Table Example

<html>
<body>
<table>
<tr><th>Name</th><th>Marks</th></tr>
<tr><td>Deo</td><td>87</td></tr>
<tr><td>Porter</td><td>89</td></tr>
<tr><td>Parker</td><td>92</td></tr>
<tr><td>Rose</td><td>97</td></tr>
</table>
</body>
</html>

Result

NameMarks
Deo87
Porter89
Parker92
Rose97

Table Example With border

<html>
<body>
<table border="1px">
<tr><th>Name</th><th>Marks</th></tr>
<tr><td>Deo</td><td>87</td></tr>
<tr><td>Porter</td><td>89</td></tr>
<tr><td>Parker</td><td>92</td></tr>
<tr><td>Rose</td><td>97</td></tr>
</table>
</body>
</html>

Result

NameMarks
Deo87
Porter89
Parker92
Rose97

Browser supported

Element
<table>YesYesYesYesYes

Prev Tutorial Next Tutorial

Google Advertisements

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 8076671483

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user. Cloud Computing Tutorial

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects. Download Java C C++ Projects

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: hitesh.xc@gmail.com or 8076671483 Try this Keyword C++ Programs