<TR> Tag & its Attribute
HTML Tag <TR>
<TR> Contains a row of cells in a table. You must place the <TR> tags inside the <TABLE> container, which can contain <TH> and <TD> tags.
Attribute of <TR> Tag
- ALIGN
- BGCOLOR
- BORDERCOLOR
- BORDERCOLORDARK
- BORDERCOLORLIGHT
- CHAR
- CHAROFF
- CLASS
- ID
- NOWRAP
- STYLE
- TITLE
- VALIGN
ALIGN
Specifies how text within the table row will line up with the edges of the table cells, or if ALIGN=CHAR, on a specific character (the decimal point).
<TR ALIGN=CENTER >
<TD><B>Television</B></TD>
<TD>
<IMG SRC="logo.gif" ALT="Logo" BORDER=0>
</TD>
</TR>
Possible Values
LEFT, RIGHT, CENTER, JUSTIFY, CHAR
BGCOLOR
Specifies the background color of table cells in the row. You can substitute the color names for the hexadecimal RGB values.
<TR BGCOLOR="Yellow">
<TD><IMG SRC="Bob.jpg" ALT="Bob"
BORDER=0></TD>
<TD ALIGN=LEFT VALIGN=MIDDLE>Welcome to cs-tutorial.com</TD>
</TR>
Possible Values
Color Name or Hexadecimal color code.
BORDERCOLOR
Specifies the color of cell borders within the row. Currently, only Internet Explorer accepts this attribute. You can substitute color names for the hexadecimal RGB values.
<TR BORDERCOLOR="#3F2A55">
<TD ALIGN=RIGHT
VALIGN=MIDDLE>Computers</TD>
<TD><IMG SRC="Computers.jpg"></TD>
</TR>
Possible Values
Color Name or Hexadecimal color code.
BORDERCOLORDARK
Indicates the darker color for the 3-D borders around the table row. You can specify the color with its hexadecimal RGB values or with its color name.
<TR BORDERCOLORLIGHT="silver"
BORDERCOLORDARK="black">
Possible Values
Color Name or Hexadecimal color code.
BORDERCOLORLIGHT
Indicates the lighter color for 3-D borders around the table row. You can specify the color with its hexadecimal RGB values or with its color name.
<TR BORDERCOLORLIGHT="silver"
BORDERCOLORDARK="black">
Possible Values
Color Name or Hexadecimal color code.
CHAR
Specifies the character on which cell contents align, if ALIGN="CHAR". If you omit CHAR=, the default value is the decimal point in the specified language.
<TR ALIGN="CHAR" CHAR=",">
Possible Values
Any Character.
CHAROFF
Specifies the number of characters from the left at which the alignment character appears.
<TR ALIGN="CHAR" CHAR="," CHAROFF="7">
Possible Values
Number of characters.
CLASS
Indicates which style class applies to the <TR> element.
<TR CLASS="sub">
<TD>PHP</TD>
<TD>ASP</TD>
<TD>JSP</TD>
</TR>
Possible Values
Any Class Name
ID
Assigns a unique ID selector to an instance of the <TR> tag. When you then assign a style to that ID selector, it affects only that one instance of the <TR> tag.
<TR ID="dkm">
Possible Values
Any ID Name
NOWRAP
Indicates that text within table cells in the row not wrap. This may cause the table to expand beyond the horizontal dimensions of the current document.
<TR NOWRAP>
<TD>this is a free tutorial website that contains a lots of information or data that helps the computer science students to study, in a new way.., </TD>
<TD>this is a free tutorial website that contains a lots of information or data that hel
Possible Values
NOWRAP
STYLE
Specifies Style Sheet commands that apply to all cells in the table row.
<TR STYLE="background: red">
Possible Values
CSS Property with Value.
TITLE
Specifies text assigned to the tag. You might use this attribute for context-sensitive help within the document. Browsers may use this to show tool tips.
<TR TITLE="Table Row">
Possible Values
Any Text Message.
VALIGN
Specifies the vertical alignment of the contents of all cells within the row.
<TR VALIGN=TOP>
<TD ALIGN=CENTER>PHP</TD>
<TD ALIGN=CENTER>HTML</TD>
</TR>
Possible Values
TOP, MIDDLE, BOTTOM, BASELINE