In HTML tables, data is organized using rows, columns, and headers. These elements work together to display information in a clear and structured way.
What are Rows
Rows are horizontal lines in a table. Each row contains one set of data.
Rows are created using the <tr> tag in HTML.
Example of Row
<tr> <td>Ali</td> <td>20</td> </tr>
What are Columns
Columns are vertical sections in a table. Each column represents a specific type of data, such as name, age, or class.
Columns are formed automatically when you place multiple <td> elements inside a row.
Example of Columns
<table> <tr> <td>Ali</td> <td>20</td> </tr> </table>
What are Headers
Headers are used to define the title of each column. They describe what type of data is inside the column.
Headers are created using the <th> tag.
Example of Headers
<table> <tr> <th>Name</th> <th>Age</th> </tr> </table>
Difference Between Rows, Columns, and Headers
Rows go from left to right and hold data.
Columns go from top to bottom and organize data types.
Headers describe each column and make the table easy to understand.
Complete Example
<table> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Ali</td> <td>20</td> </tr> <tr> <td>Sara</td> <td>22</td> </tr> </table>
Summary
Rows, columns, and headers are the basic structure of an HTML table. Rows store data, columns organize it, and headers explain it clearly.