Home  >  Article  >  Web Front-end  >  How can we add a table row in HTML?

How can we add a table row in HTML?

WBOY
WBOYforward
2023-09-07 15:09:021217browse

How can we add a table row in HTML?

Add table rows using the

tag. The HTML tag is used to specify a table row in the table. The

HTML

tag also supports the following additional attributes −bgcolorrgb(x,x,x)Char#CharacterCharoffpixels or %##has Deprecated ValignDeprecated Example
Attribute

Value

Description

Align

right

left

center

justify

char

##Deprecated − Visual alignment .

#hexcode

colorname

Deprecated − Specifies the background color of table cells.

Deprecated − Specifies the characters to align text. Used when align = "char".

− Specifies the alignment offset (expressed as a pixel or percentage value) aligned with the first character specified by the char attribute. Used when align = "char".

topmiddlebottombaseline − Vertical alignment

You can try running 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>

The above is the detailed content of How can we add a table row in HTML?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete