--- title: slug: Web/HTML/Element/tr translation_of: Web/HTML/Element/tr ---

개요

The HTML Table Row Element (<tr>) defines a row of cells in a table. Those can be a mix of {{HTMLElement("td")}} and {{HTMLElement("th")}} elements.

사용 문맥

콘텐츠 범주 None.
허용되는 콘텐츠 Zero or more {{HTMLElement("td")}} or {{HTMLElement("th")}} elements, or a mix of them
태그 생략 The start tag is mandatory. The end tag may be omitted if the {{HTMLElement("tr")}} element is immediately followed by a {{HTMLElement("tr")}} element, or if the parent table group ({{HTMLElement("thead")}}, {{HTMLElement("tbody")}} or {{HTMLElement("tfoot")}}) element doesn't have any more content.
허용되는 부모 요소 A {{HTMLElement("table")}}, {{HTMLElement("thead")}}, {{HTMLElement("tbody")}} or {{HTMLElement("tfoot")}} element.
Normative document HTML, "The tr element"

속성

This element includes the global attributes.

{{htmlattrdef("align")}} {{deprecatedGeneric("inline","html4.01")}}, {{obsoleteGeneric("inline","html5")}}
This enumerated attribute specifies how horizontal alignment of each cell content will be handled. Possible values are:

If this attribute is not set, the parent node's value is inherited.

참고: Do not use this attribute as it is obsolete (not supported) in the latest standard.
  • To achieve the same effect as the left, center, right or justify values, use the CSS {{cssxref("text-align")}} property on it.
  • To achieve the same effect as the char value, in CSS3, you can use the value of the {{htmlattrxref("char", "tr")}} as the value of the {{cssxref("text-align")}} property {{unimplemented_inline}}.
{{htmlattrdef("bgcolor")}} {{deprecatedGeneric("inline","html4.01")}}, {{obsoleteGeneric("inline","html5")}}
This attribute defines the background color of each cell of the row. It can be either an #RRGGBB code or an SVG color keyword.
Usage note: the {{HTMLElement("tr")}} element should be styled using CSS. To give a similar effect to the bgcolor attribute, use the CSS property {{cssxref("background-color")}}.
{{htmlattrdef("char")}} {{deprecatedGeneric("inline","html4.01")}}, {{obsoleteGeneric("inline","html5")}}
This attribute is used to set the character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If {{htmlattrxref("align", "tr")}} is not set to char, this attribute is ignored.
참고: Do not use this attribute as it is obsolete (and not supported) in the latest standard. To achieve the same effect as the {{htmlattrxref("char", "tr")}}, in CSS3, you can use the character set using the {{htmlattrxref("char", "tr")}} attribute as the value of the {{cssxref("text-align")}} property {{unimplemented_inline}}.
{{htmlattrdef("charoff")}} {{deprecatedGeneric("inline","html4.01")}}, {{obsoleteGeneric("inline","html5")}}
This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the char attribute.
참고: Do not use this attribute as it is obsolete (and not supported) in the latest standard.
{{htmlattrdef("valign")}} {{deprecatedGeneric("inline","html4.01")}}, {{obsoleteGeneric("inline","html5")}}
This attribute specifies the vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are:
Note: Do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the CSS {{cssxref("vertical-align")}} property on it.

DOM 인터페이스

This element implements the {{domxref("HTMLTableRowElement")}} interface.

예제

See {{HTMLElement("table")}} for examples on <tr>.

브라우저 호환성

{{CompatibilityTable}}

기능 Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 {{CompatGeckoDesktop("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
align/valign 속성 1.0 {{CompatNo}} {{bug("915")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
char/charoff 속성 1.0 {{CompatNo}} {{bug("2212")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
bgcolor 속성 {{Non-standard_inline}} {{CompatNo}} {{CompatNo}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}}
기능 Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{CompatGeckoMobile("1.0")}} {{CompatVersionUnknown}} {{CompatVersionUnknown}} {{CompatVersionUnknown}}
align/valign 속성 {{CompatUnknown}} {{CompatNo}} {{bug("915")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
char/charoff 속성 {{CompatUnknown}} {{CompatNo}} {{bug("2212")}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
bgcolor 속성 {{Non-standard_inline}} {{CompatNo}} {{CompatNo}} {{CompatVersionUnknown}} {{CompatNo}} {{CompatNo}}

같이 보기

{{HTMLRef}}