How to create table rows & columns in HTML?

HTMLWeb DevelopmentFront End Technology

To create table rows and columns in HTML, use the <table> tag. A table consist of rows and columns, which can be set using one or more <tr>, <th>, and <td> elements. A table row is defined by the <tr> tag. For table rows and columns, <tr> tag and <td> tag is used respectively. The <td> tag

Just keep in mind, a lot of table attributes such as align, bgcolor, border, cellpadding, cellspacing aren’t supported by HTML5. Do not use them. Use the style attribute to add CSS properties for adding a border to the table. We’re also using the <style> tag to style the table borders.


You can try to run the following code to create table rows and columns in HTML.

<!DOCTYPE html>
         table, th, td {
            border: 1px solid black;

      <h2>Understanding Tables</h2>
            <th>Header: This is row1 column1</th>
            <th>Header: This is row1 column2</th>
            <td>This is row2 column1</td>
            <td>This is row2 column2</td>


Updated on 22-Dec-2021 09:27:59