Question:

Write the HTML code to create a table with 3 rows and 2 columns.

Updated On: Feb 27, 2026
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Concept:

In HTML:

  • <table> defines the table. 
  • <tr> defines a table row.
  • <td> defines a table cell (column).

To create a table with \( 3 \) rows and \( 2 \) columns:

  • Use \( 3 \) <tr> tags.
  • Each row must contain \( 2 \) <td> tags.


Step 1: Start the table structure using <table> and </table>

Step 2: Create rows using <tr>. Each row represents horizontal entries. 

Step 3: Add columns using <td>. Two <td> elements inside each row give \( 2 \) columns. 

Step 4: Complete HTML code:<table border="1">    <tr>        <td>Row1 Col1</td>        <td>Row1 Col2</td>    </tr>    <tr>        <td>Row2 Col1</td>        <td>Row2 Col2</td>    </tr>    <tr>        <td>Row3 Col1</td>        <td>Row3 Col2</td>    </tr> </table> 
Conclusion:
The table contains \( 3 \) rows and \( 2 \) columns created using <tr> and <td> tags inside a <table> element.

Was this answer helpful?
0
0