tr Creating Table Rows

<tr> Creating Table Rows

You use <tr> to create rows in a table. This element can contain <th> (table header) and <td> (table data) elements. It is supported in XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, and XHTML 1.1. Here are this element's attributes:

  • align Specifies the horizontal alignment of the text in this table row. You can set this to left , center , right , justify , or char . Unlike other align attributes, this one is not deprecated. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • bgcolor Deprecated in HTML 4.0. Specifies the background color of the table cells . (XHTML 1.0 Transitional, XHTML 1.0 Frameset.)

  • char Specifies a character to align text on. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • charoff Sets the alignment offset to the first character to align on (which you set with char ). (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • class Gives the style class of the element. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • dir Sets the direction of text that doesn't have an inherent direction in which you should read it, called directionally neutral text. You can set this attribute to ltr , for left-to-right text, or rtl , for right-to-left text. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • id Refers to the element; set this attribute to a unique identifier. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • lang Specifies the base language used in the element. Applies only when the document is interpreted as HTML. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • style Inline style indicating how to render the element. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • title Contains the title of the element. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • valign Sets the vertical alignment of the data in this row. Possible values are top , middle , bottom , and baseline . (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

  • xml:lang Specifies the base language for the element when the document is interpreted as an XML document. (XHTML 1.0 Strict, XHTML 1.0 Transitional, XHTML 1.0 Frameset, XHTML 1.1.)

Here are the events supported by this element: onclick , ondblclick , onfocus , onblur , onmousedown , onmouseup , onmouseover , onmousemove , onmouseout , onkeypress , onkeydown , and onkeyup .

You use <tr> inside <table> to create a row in a table. Here's how that looks:

 <table>  <tr>   <td>   Table Data   </td>   .   .   .   </tr>  .     .     . </table> 

There's a <tr> element for every row in an XHTML table, and the browser knows how many rows there will be in the table by counting the number of <tr> elements. This element contains <tr> elements, which you use to create table headers, and <td> elements, which hold the actual data in the cells in a table.



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net