Table in HTML

Table in HTML

Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). Td stands for "table data," and holds the content of a data cell. A <td> tag can contain text, links, images, lists, forms, other tables, etc.


<table border="1">
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>

HTML Table Tags

<table> Defines a table

<th> Defines a table header

<tr> Defines a table row

<td> Defines a table cell

<caption> Defines a table caption

Attribute of <table> tag

  • Height to set the height of table
  • Width to set the width of table
  • Bgcolor to set the background color table
  • Cellpadding to set the space between text and table border
  • Cellspacing to set the space between two cells

Example Programs

Program [1]

 Using HTML

(a) Create a 4x3 table

(b) Within table, place 12 images of Indian Tourist Spots, in each box

(c) Each image should link to the corresponding Website of the Tourist Spot

(d) Each Image must be at least 100x100 in size

View Solution

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Website development Company in Allahabad Sarkari Exam Quiz