
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How do we add a table row in HTML?
Use the <tr> tag to add a table row. The HTML <tr> tag is used for specifying a table row within a table.
The HTML <tr> tag also supports the following additional attributes −
Attribute | Value | Description |
---|---|---|
Align | right left center justify char | Deprecated − Visual alignment. |
bgcolor | rgb(x,x,x) #hexcode colorname | Deprecated − Specifies the background color of the table cell. |
Char | Character | Deprecated − Specifies which character to align text on. Used when align = "char". |
Charoff | pixels or % | Deprecated − Specifies an alignment offset (either in pixels or percentage value) against the first character as specified with the char attribute. Used when align = "char". |
Valign | top middle bottom baseline | Deprecated − Vertical alignment |
Example
You can try to run the following code to learn how to add a row in an HTML table −
<!DOCTYPE html> <html> <head> <title>HTML tr Tag</title> </head> <body> <table border = "1"> <tr> <th>Cricketers</th> <th>Ranking</th> </tr> <tr> <td>Virat Kohli</td> <td>1</td> </tr> <tr> <td>AB de Villiers</td> <td>2</td> </tr> </table> </body> </html>
- Related Articles
- How do we add a definition term in HTML?
- How do we add a menu list in HTML?
- How do we add a comment in HTML code?
- How do we add a noframe section in HTML?
- How do we add a noscript section in HTML?
- How do we include a table caption in HTML?
- How do we display a table cell in HTML
- How do we add document title in HTML?
- How do we add glossary definitions in HTML?
- How do we add bold text in HTML?
- How do we add a sample computer code in HTML?
- How do we add a push button to HTML?
- How do we add a single-line input field in HTML?
- How do we include attributes for table columns in HTML?
- How to add table row in jQuery?

Advertisements