KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2     GNU LESSER GENERAL PUBLIC LICENSE
3     Copyright (C) 2006 The Lobo Project
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13     Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19     Contact info: xamjadmin@users.sourceforge.net
20 */

21 /*
22  * Copyright (c) 2003 World Wide Web Consortium,
23  * (Massachusetts Institute of Technology, Institut National de
24  * Recherche en Informatique et en Automatique, Keio University). All
25  * Rights Reserved. This program is distributed under the W3C's Software
26  * Intellectual Property License. This program is distributed in the
27  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
28  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29  * PURPOSE.
30  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
31  */

32
33 package org.w3c.dom.html2;
34
35 import org.w3c.dom.DOMException JavaDoc;
36
37 /**
38  * The create* and delete* methods on the table allow authors to construct and
39  * modify tables. [<a HREF='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>] specifies that only one of each of the
40  * <code>CAPTION</code>, <code>THEAD</code>, and <code>TFOOT</code> elements
41  * may exist in a table. Therefore, if one exists, and the createTHead() or
42  * createTFoot() method is called, the method returns the existing THead or
43  * TFoot element. See the TABLE element definition in HTML 4.01.
44  * <p>See also the <a HREF='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
45  */

46 public interface HTMLTableElement extends HTMLElement {
47     /**
48      * Returns the table's <code>CAPTION</code>, or void if none exists.
49      * @version DOM Level 2
50      */

51     public HTMLTableCaptionElement getCaption();
52     /**
53      * Returns the table's <code>CAPTION</code>, or void if none exists.
54      * @exception DOMException
55      * HIERARCHY_REQUEST_ERR: if the element is not a <code>CAPTION</code>.
56      * @version DOM Level 2
57      */

58     public void setCaption(HTMLTableCaptionElement caption)
59                           throws DOMException JavaDoc;
60
61     /**
62      * Returns the table's <code>THEAD</code>, or <code>null</code> if none
63      * exists.
64      * @version DOM Level 2
65      */

66     public HTMLTableSectionElement getTHead();
67     /**
68      * Returns the table's <code>THEAD</code>, or <code>null</code> if none
69      * exists.
70      * @exception DOMException
71      * HIERARCHY_REQUEST_ERR: if the element is not a <code>THEAD</code>.
72      * @version DOM Level 2
73      */

74     public void setTHead(HTMLTableSectionElement tHead)
75                           throws DOMException JavaDoc;
76
77     /**
78      * Returns the table's <code>TFOOT</code>, or <code>null</code> if none
79      * exists.
80      * @version DOM Level 2
81      */

82     public HTMLTableSectionElement getTFoot();
83     /**
84      * Returns the table's <code>TFOOT</code>, or <code>null</code> if none
85      * exists.
86      * @exception DOMException
87      * HIERARCHY_REQUEST_ERR: if the element is not a <code>TFOOT</code>.
88      * @version DOM Level 2
89      */

90     public void setTFoot(HTMLTableSectionElement tFoot)
91                           throws DOMException JavaDoc;
92
93     /**
94      * Returns a collection of all the rows in the table, including all in
95      * <code>THEAD</code>, <code>TFOOT</code>, all <code>TBODY</code>
96      * elements.
97      */

98     public HTMLCollection getRows();
99
100     /**
101      * Returns a collection of the table bodies (including implicit ones).
102      */

103     public HTMLCollection getTBodies();
104
105     /**
106      * Specifies the table's position with respect to the rest of the
107      * document. See the align attribute definition in HTML 4.01. This
108      * attribute is deprecated in HTML 4.01.
109      */

110     public String JavaDoc getAlign();
111     /**
112      * Specifies the table's position with respect to the rest of the
113      * document. See the align attribute definition in HTML 4.01. This
114      * attribute is deprecated in HTML 4.01.
115      */

116     public void setAlign(String JavaDoc align);
117
118     /**
119      * Cell background color. See the bgcolor attribute definition in HTML
120      * 4.01. This attribute is deprecated in HTML 4.01.
121      */

122     public String JavaDoc getBgColor();
123     /**
124      * Cell background color. See the bgcolor attribute definition in HTML
125      * 4.01. This attribute is deprecated in HTML 4.01.
126      */

127     public void setBgColor(String JavaDoc bgColor);
128
129     /**
130      * The width of the border around the table. See the border attribute
131      * definition in HTML 4.01.
132      */

133     public String JavaDoc getBorder();
134     /**
135      * The width of the border around the table. See the border attribute
136      * definition in HTML 4.01.
137      */

138     public void setBorder(String JavaDoc border);
139
140     /**
141      * Specifies the horizontal and vertical space between cell content and
142      * cell borders. See the cellpadding attribute definition in HTML 4.01.
143      */

144     public String JavaDoc getCellPadding();
145     /**
146      * Specifies the horizontal and vertical space between cell content and
147      * cell borders. See the cellpadding attribute definition in HTML 4.01.
148      */

149     public void setCellPadding(String JavaDoc cellPadding);
150
151     /**
152      * Specifies the horizontal and vertical separation between cells. See the
153      * cellspacing attribute definition in HTML 4.01.
154      */

155     public String JavaDoc getCellSpacing();
156     /**
157      * Specifies the horizontal and vertical separation between cells. See the
158      * cellspacing attribute definition in HTML 4.01.
159      */

160     public void setCellSpacing(String JavaDoc cellSpacing);
161
162     /**
163      * Specifies which external table borders to render. See the frame
164      * attribute definition in HTML 4.01.
165      */

166     public String JavaDoc getFrame();
167     /**
168      * Specifies which external table borders to render. See the frame
169      * attribute definition in HTML 4.01.
170      */

171     public void setFrame(String JavaDoc frame);
172
173     /**
174      * Specifies which internal table borders to render. See the rules
175      * attribute definition in HTML 4.01.
176      */

177     public String JavaDoc getRules();
178     /**
179      * Specifies which internal table borders to render. See the rules
180      * attribute definition in HTML 4.01.
181      */

182     public void setRules(String JavaDoc rules);
183
184     /**
185      * Description about the purpose or structure of a table. See the summary
186      * attribute definition in HTML 4.01.
187      */

188     public String JavaDoc getSummary();
189     /**
190      * Description about the purpose or structure of a table. See the summary
191      * attribute definition in HTML 4.01.
192      */

193     public void setSummary(String JavaDoc summary);
194
195     /**
196      * Specifies the desired table width. See the width attribute definition
197      * in HTML 4.01.
198      */

199     public String JavaDoc getWidth();
200     /**
201      * Specifies the desired table width. See the width attribute definition
202      * in HTML 4.01.
203      */

204     public void setWidth(String JavaDoc width);
205
206     /**
207      * Create a table header row or return an existing one.
208      * @return A new table header element (<code>THEAD</code>).
209      */

210     public HTMLElement createTHead();
211
212     /**
213      * Delete the header from the table, if one exists.
214      */

215     public void deleteTHead();
216
217     /**
218      * Create a table footer row or return an existing one.
219      * @return A footer element (<code>TFOOT</code>).
220      */

221     public HTMLElement createTFoot();
222
223     /**
224      * Delete the footer from the table, if one exists.
225      */

226     public void deleteTFoot();
227
228     /**
229      * Create a new table caption object or return an existing one.
230      * @return A <code>CAPTION</code> element.
231      */

232     public HTMLElement createCaption();
233
234     /**
235      * Delete the table caption, if one exists.
236      */

237     public void deleteCaption();
238
239     /**
240      * Insert a new empty row in the table. The new row is inserted
241      * immediately before and in the same section as the current
242      * <code>index</code>th row in the table. If <code>index</code> is -1 or
243      * equal to the number of rows, the new row is appended. In addition,
244      * when the table is empty the row is inserted into a <code>TBODY</code>
245      * which is created and inserted into the table.A table row cannot be
246      * empty according to [<a HREF='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>].
247      * @param index The row number where to insert a new row. This index
248      * starts from 0 and is relative to the logical order (not document
249      * order) of all the rows contained inside the table.
250      * @return The newly created row.
251      * @exception DOMException
252      * INDEX_SIZE_ERR: Raised if the specified index is greater than the
253      * number of rows or if the index is a negative number other than -1.
254      * @version DOM Level 2
255      */

256     public HTMLElement insertRow(int index)
257                                  throws DOMException JavaDoc;
258
259     /**
260      * Delete a table row.
261      * @param index The index of the row to be deleted. This index starts
262      * from 0 and is relative to the logical order (not document order) of
263      * all the rows contained inside the table. If the index is -1 the
264      * last row in the table is deleted.
265      * @exception DOMException
266      * INDEX_SIZE_ERR: Raised if the specified index is greater than or
267      * equal to the number of rows or if the index is a negative number
268      * other than -1.
269      * @version DOM Level 2
270      */

271     public void deleteRow(int index)
272                           throws DOMException JavaDoc;
273
274 }
275
Popular Tags