HTML <tr> Tag
Description
The <tr>
HTML element serves as a container for creating a table row. Each cell within such a row is set using the <th>
or <td>
element.
Properties
- Permitted Parents
<table>
(only if the table has no child<tbody>
element, and even then only after any<caption>
,<colgroup>
, and<thead>
elements); otherwise, the parent must be<thead>
,<tbody>
or<tfoot>
- Content
<th>
,<td>
- Start/End Tags
- Start tag: optional, End tag: optional
Example
<table border="1">
<tr>
<td>Cat</td>
<td>Dog</td>
</tr>
<tr>
<td>Mouse</td>
<td>Bird</td>
</tr>
</table>
Attributes
Attribute | Definition |
---|---|
bgcolor | Background color of the tr. This attribute is not supported in HTML5, use CSS background-color property. |
align | Visual alignment. Possible values:
This attribute is not supported in HTML5. |
valign | Vertical alignment. Possible values:
This attribute is not supported in HTML5. |
char | Specifies a character to use for aligning text
to. Used when align=char.
This attribute is not supported in HTML5. |
charoff | Specifies an alignment offset (either in pixels
or percentage value) against the first character as
specified with the char attribute. Used when
align=char
This attribute is not supported in HTML5. |
Global Attributes
The <tr>
tag also supports the Global Attributes in HTML5
Event Attributes
The <tr>
tag also supports the Event Attributes in HTML5
Browser Support
Desktop | |||||
Yes | Yes | 1 | 1 | Yes | Yes |
Tablets / Mobile | |||||
![]() |
|||||
Yes | Yes | 4 | Yes | Yes | Yes |
Last updated by CSSPortal on: 6th December 2019
HTML Tags
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- body
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- comment
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- doctype
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- keygen
- label
- legend
- li
- link
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rp
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr