定義Specifies that the contained content is organized into a table with rows and columns. 說(shuō)明所含內(nèi)容組織成含有行和列的表格形式。 注釋下列標(biāo)簽可在表格結(jié)構(gòu)中出現(xiàn): CAPTION, COL, COLGROUP, TBODY, TD, TFOOT, TH, THEAD 和 TR。 對(duì)于每個(gè) table 對(duì)象,僅可指定一個(gè) tHead 和 tFoot。 在文檔載入的過(guò)程中,對(duì)表格的修改將被限制,直到 onload 事件發(fā)生。任何時(shí)刻都允許只讀訪問(wèn)。 表格對(duì)象模型對(duì)于數(shù)據(jù)綁定的表格是只讀的。例如,用于刪除表格行的腳本可以在未綁定的表格上正確運(yùn)行,但無(wú)法在已綁定數(shù)據(jù)的表格上運(yùn)行。table 對(duì)象的屬性仍舊可用,但是對(duì)表格中的綁定數(shù)據(jù)進(jìn)行的更改必須通過(guò)數(shù)據(jù)源。 表格的屬性區(qū)分于表格中所包含的單元格的屬性。例如,多列表格的 offsetLeft 屬性與表格中最左端單元格的 offsetLeft 屬性并不相同。請(qǐng)?jiān)诰帉?xiě)腳本時(shí)選擇正確的表格和/或單元格對(duì)象。 table 對(duì)象及其相關(guān)的元素有各自獨(dú)立的表格對(duì)象模型,這與常規(guī)對(duì)象模型所采用的方法有很大不同。要獲得關(guān)于表格對(duì)象模型更多的信息,請(qǐng)參看如何動(dòng)態(tài)生成表格。 在腳本中訪問(wèn) height 屬性時(shí),請(qǐng)使用 pixelHeight 或 posHeight 屬性控制高度的數(shù)值。 如果想要對(duì)高度和寬度進(jìn)行動(dòng)態(tài)變更,那么原始值必須是通過(guò)樣式指定的(例如,style="height:200px; width:200px"),而不是通過(guò) height 和 width 標(biāo)簽屬性。 表格的許多樣式并不從 table 和其父對(duì)象中繼承。這其中包括: font-size; font-weight; line-height; text-align; font-style; font-variant。 此元素在 Internet Explorer 3.0 及以上版本的 HTML 中可用,在 Internet Explorer 4.0 及以上版本的腳本中可用。 此元素是一個(gè)塊元素。 此元素需要關(guān)閉標(biāo)簽。 The following tags are valid in table construction: CAPTION, COL, COLGROUP, TBODY, TD, TFOOT, TH, THEAD, and TR. For each table object, only one tHead and tFoot can be specified. While a document loads, modifications to a table are restricted until the onload event occurs. Read-only access is allowed at any time. The table object model is read-only for databound tables. For example, script used to remove a table row works correctly on an unbound table, but not on a databound table. The properties of a table object are still available, but changes to the bound data in a table must be made to the data source. The properties of a table are distinct from the properties of cells contained within the table. For example, the offsetLeft property of a multicolumn table is not the same as the offsetLeft property of the left-most cell in the table. Refer to the appropriate object when writing scripts involving table and/or cell objects. The table object and its associated elements have a separate table object model, which utilizes different methods than the general object model. For more information on the table object model, see How to Build Tables Dynamically. When scripting the height property, use either the pixelHeight or posHeight property to numerically manipulate the height value. If dynamic changes are intended for the height and width, the original values should be set through style (for example, style="height:200px; width:200px") rather than through the height and width attributes. Many styles do not inherit to a table and its contents from its parent object. Among these are: font-size; font-weight; line-height; text-align; font-style; font-variant. This element is available in HTML as of Internet Explorer 3.0, and in script as of Internet Explorer 4.0. This element is a block element. This element requires a closing tag. 示例代碼<TABLE BORDER=1 WIDTH=80%> <THEAD> <TR> <TH>Heading 1</TH> <TH>Heading 2</TH> </TR> </THEAD> <TBODY> <TR> <TD>Row 1, Column 1 text.</TD> <TD>Row 1, Column 2 text.</TD> </TR> <TR> <TD>Row 2, Column 1 text.</TD> <TD>Row 2, Column 2 text.</TD> </TR> </TBODY> </TABLE> |
|