

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create table rows & columns in HTML?
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.
Example
You can try to run the following code to create table rows and columns in HTML.
<!DOCTYPE html> <html> <head> <style> table, th, td { border: 1px solid black; } </style> </head> <body> <h2>Understanding Tables</h2> <table> <tr> <th>Header: This is row1 column1</th> <th>Header: This is row1 column2</th> </tr> <tr> <td>This is row2 column1</td> <td>This is row2 column2</td> </tr> </table> </body> </html>
Output
- Related Questions & Answers
- How to layout table cells, rows, and columns with JavaScript?
- How to merge table columns in HTML?
- How to create a GridLayout with rows and columns in Java?
- How to create table border in HTML?
- How to create table header in HTML?
- How to create table footer in HTML?
- How to create table heading in HTML?
- In HTML how to create table header?
- HTML DOM Table rows Collection
- How to include groups of table columns in HTML?
- Add new MySQL table columns and create indexes?
- How to multiply a matrix columns and rows with the same matrix rows and columns in R?
- Create a table in HTML
- How to create conditions in a MySQL table with multiple columns?
- How do we include attributes for table columns in HTML?
Advertisements