KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > w3c > dom > html > HTMLTableElement


1 /*
2  * Copyright (c) 2000 World Wide Web Consortium,
3  * (Massachusetts Institute of Technology, Institut National de
4  * Recherche en Informatique et en Automatique, Keio University). All
5  * Rights Reserved. This program is distributed under the W3C's Software
6  * Intellectual Property License. This program is distributed in the
7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
10  * details.
11  */

12
13 package org.w3c.dom.html;
14
15 import org.w3c.dom.DOMException JavaDoc;
16
17 /**
18  * The create* and delete* methods on the table allow authors to construct
19  * and modify tables. HTML 4.0 specifies that only one of each of the
20  * <code>CAPTION</code> , <code>THEAD</code> , and <code>TFOOT</code>
21  * elements may exist in a table. Therefore, if one exists, and the
22  * createTHead() or createTFoot() method is called, the method returns the
23  * existing THead or TFoot element. See the TABLE element definition in HTML
24  * 4.0.
25  * <p>See also the <a HREF='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
26  */

27 public interface HTMLTableElement extends HTMLElement {
28     /**
29      * Returns the table's <code>CAPTION</code> , or void if none exists.
30      */

31     public HTMLTableCaptionElement getCaption();
32     public void setCaption(HTMLTableCaptionElement caption);
33
34     /**
35      * Returns the table's <code>THEAD</code> , or <code>null</code> if none
36      * exists.
37      */

38     public HTMLTableSectionElement getTHead();
39     public void setTHead(HTMLTableSectionElement tHead);
40
41     /**
42      * Returns the table's <code>TFOOT</code> , or <code>null</code> if none
43      * exists.
44      */

45     public HTMLTableSectionElement getTFoot();
46     public void setTFoot(HTMLTableSectionElement tFoot);
47
48     /**
49      * Returns a collection of all the rows in the table, including all in
50      * <code>THEAD</code> , <code>TFOOT</code> , all <code>TBODY</code>
51      * elements.
52      */

53     public HTMLCollection getRows();
54
55     /**
56      * Returns a collection of the defined table bodies.
57      */

58     public HTMLCollection getTBodies();
59
60     /**
61      * Specifies the table's position with respect to the rest of the
62      * document. See the align attribute definition in HTML 4.0. This
63      * attribute is deprecated in HTML 4.0.
64      */

65     public String JavaDoc getAlign();
66     public void setAlign(String JavaDoc align);
67
68     /**
69      * Cell background color. See the bgcolor attribute definition in HTML
70      * 4.0. This attribute is deprecated in HTML 4.0.
71      */

72     public String JavaDoc getBgColor();
73     public void setBgColor(String JavaDoc bgColor);
74
75     /**
76      * The width of the border around the table. See the border attribute
77      * definition in HTML 4.0.
78      */

79     public String JavaDoc getBorder();
80     public void setBorder(String JavaDoc border);
81
82     /**
83      * Specifies the horizontal and vertical space between cell content and
84      * cell borders. See the cellpadding attribute definition in HTML 4.0.
85      */

86     public String JavaDoc getCellPadding();
87     public void setCellPadding(String JavaDoc cellPadding);
88
89     /**
90      * Specifies the horizontal and vertical separation between cells. See
91      * the cellspacing attribute definition in HTML 4.0.
92      */

93     public String JavaDoc getCellSpacing();
94     public void setCellSpacing(String JavaDoc cellSpacing);
95
96     /**
97      * Specifies which external table borders to render. See the frame
98      * attribute definition in HTML 4.0.
99      */

100     public String JavaDoc getFrame();
101     public void setFrame(String JavaDoc frame);
102
103     /**
104      * Specifies which internal table borders to render. See the rules
105      * attribute definition in HTML 4.0.
106      */

107     public String JavaDoc getRules();
108     public void setRules(String JavaDoc rules);
109
110     /**
111      * Description about the purpose or structure of a table. See the
112      * summary attribute definition in HTML 4.0.
113      */

114     public String JavaDoc getSummary();
115     public void setSummary(String JavaDoc summary);
116
117     /**
118      * Specifies the desired table width. See the width attribute definition
119      * in HTML 4.0.
120      */

121     public String JavaDoc getWidth();
122     public void setWidth(String JavaDoc width);
123
124     /**
125      * Create a table header row or return an existing one.
126      * @return A new table header element (<code>THEAD</code> ).
127      */

128     public HTMLElement createTHead();
129
130     /**
131      * Delete the header from the table, if one exists.
132      */

133     public void deleteTHead();
134
135     /**
136      * Create a table footer row or return an existing one.
137      * @return A footer element (<code>TFOOT</code> ).
138      */

139     public HTMLElement createTFoot();
140
141     /**
142      * Delete the footer from the table, if one exists.
143      */

144     public void deleteTFoot();
145
146     /**
147      * Create a new table caption object or return an existing one.
148      * @return A <code>CAPTION</code> element.
149      */

150     public HTMLElement createCaption();
151
152     /**
153      * Delete the table caption, if one exists.
154      */

155     public void deleteCaption();
156
157     /**
158      * Insert a new empty row in the table. The new row is inserted
159      * immediately before and in the same section as the current
160      * <code>index</code> th row in the table. If <code>index</code> is equal
161      * to the number of rows, the new row is appended. In addition, when the
162      * table is empty the row is inserted into a <code>TBODY</code> which is
163      * created and inserted into the table. Note. A table row cannot be empty
164      * according to HTML 4.0 Recommendation.
165      * @param index The row number where to insert a new row. This index
166      * starts from 0 and is relative to all the rows contained inside the
167      * table, regardless of section parentage.
168      * @return The newly created row.
169      * @exception DOMException
170      * INDEX_SIZE_ERR: Raised if the specified index is greater than the
171      * number of rows or if the index is negative.
172      */

173     public HTMLElement insertRow(int index)
174                                  throws DOMException JavaDoc;
175
176     /**
177      * Delete a table row.
178      * @param index The index of the row to be deleted. This index starts
179      * from 0 and is relative to all the rows contained inside the table,
180      * regardless of section parentage.
181      * @exception DOMException
182      * INDEX_SIZE_ERR: Raised if the specified index is greater than or
183      * equal to the number of rows or if the index is negative.
184      */

185     public void deleteRow(int index)
186                           throws DOMException JavaDoc;
187
188 }
189
190
Popular Tags