KHtml

html_table.h
1 /*
2  * This file is part of the DOM implementation for KDE.
3  *
4  * Copyright 1999 Lars Knoll ([email protected])
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  *
21  * This file includes excerpts from the Document Object Model (DOM)
22  * Level 1 Specification (Recommendation)
23  * https://www.w3.org/TR/REC-DOM-Level-1/
24  * Copyright © World Wide Web Consortium , (Massachusetts Institute of
25  * Technology , Institut National de Recherche en Informatique et en
26  * Automatique , Keio University ). All Rights Reserved.
27  *
28  */
29 #ifndef HTML_TABLE_H
30 #define HTML_TABLE_H
31 
32 // --------------------------------------------------------------------------
33 #include <khtml_export.h>
34 #include <dom/html_element.h>
35 
36 namespace DOM
37 {
38 
39 class HTMLTableCaptionElementImpl;
40 class DOMString;
41 
42 /**
43  * Table caption See the <a
44  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#edef-CAPTION">
45  * CAPTION element definition </a> in HTML 4.0.
46  *
47  */
48 class KHTML_EXPORT HTMLTableCaptionElement : public HTMLElement
49 {
50  friend class HTMLTableElement;
51 
52 public:
55  HTMLTableCaptionElement(const Node &other) : HTMLElement()
56  {
57  (*this) = other;
58  }
59 protected:
60  HTMLTableCaptionElement(HTMLTableCaptionElementImpl *impl);
61 public:
62 
63  HTMLTableCaptionElement &operator = (const HTMLTableCaptionElement &other);
64  HTMLTableCaptionElement &operator = (const Node &other);
65 
67 
68  /**
69  * Caption alignment with respect to the table. See the <a
70  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-CAPTION">
71  * align attribute definition </a> in HTML 4.0. This attribute is
72  * deprecated in HTML 4.0.
73  *
74  */
75  DOMString align() const;
76 
77  /**
78  * see align
79  */
80  void setAlign(const DOMString &);
81 };
82 
83 // --------------------------------------------------------------------------
84 
85 class HTMLTableCellElementImpl;
86 
87 /**
88  * The object used to represent the \c TH and \c TD
89  * elements. See the <a
90  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#edef-TD">
91  * TD element definition </a> in HTML 4.0.
92  *
93  */
94 class KHTML_EXPORT HTMLTableCellElement : public HTMLElement
95 {
96  friend class HTMLTableElement;
97 
98 public:
101  HTMLTableCellElement(const Node &other) : HTMLElement()
102  {
103  (*this) = other;
104  }
105 protected:
106  HTMLTableCellElement(HTMLTableCellElementImpl *impl);
107 public:
108 
109  HTMLTableCellElement &operator = (const HTMLTableCellElement &other);
110  HTMLTableCellElement &operator = (const Node &other);
111 
113 
114  /**
115  * The index of this cell in the row.
116  *
117  */
118  long cellIndex() const;
119 
120  /**
121  * see cellIndex
122  *
123  * This function is obsolete - the cellIndex property is actually supposed to be read-only
124  * (https://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
125  */
126  void setCellIndex(long);
127 
128  /**
129  * Abbreviation for header cells. See the <a
130  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-abbr">
131  * abbr attribute definition </a> in HTML 4.0.
132  *
133  */
134  DOMString abbr() const;
135 
136  /**
137  * see abbr
138  */
139  void setAbbr(const DOMString &);
140 
141  /**
142  * Horizontal alignment of data in cell. See the <a
143  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TD">
144  * align attribute definition </a> in HTML 4.0.
145  *
146  */
147  DOMString align() const;
148 
149  /**
150  * see align
151  */
152  void setAlign(const DOMString &);
153 
154  /**
155  * Names group of related headers. See the <a
156  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-axis">
157  * axis attribute definition </a> in HTML 4.0.
158  *
159  */
160  DOMString axis() const;
161 
162  /**
163  * see axis
164  */
165  void setAxis(const DOMString &);
166 
167  /**
168  * Cell background color. See the <a
169  * href="https://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
170  * bgcolor attribute definition </a> in HTML 4.0. This attribute
171  * is deprecated in HTML 4.0.
172  *
173  */
174  DOMString bgColor() const;
175 
176  /**
177  * see bgColor
178  */
179  void setBgColor(const DOMString &);
180 
181  /**
182  * Alignment character for cells in a column. See the <a
183  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
184  * char attribute definition </a> in HTML 4.0.
185  *
186  */
187  DOMString ch() const;
188 
189  /**
190  * see ch
191  */
192  void setCh(const DOMString &);
193 
194  /**
195  * Offset of alignment character. See the <a
196  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
197  * charoff attribute definition </a> in HTML 4.0.
198  *
199  */
200  DOMString chOff() const;
201 
202  /**
203  * see chOff
204  */
205  void setChOff(const DOMString &);
206 
207  /**
208  * Number of columns spanned by cell. See the <a
209  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-colspan">
210  * colspan attribute definition </a> in HTML 4.0.
211  *
212  */
213  long colSpan() const;
214 
215  /**
216  * see colSpan
217  */
218  void setColSpan(long);
219 
220  /**
221  * List of \c id attribute values for header cells.
222  * See the <a
223  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-headers">
224  * headers attribute definition </a> in HTML 4.0.
225  *
226  */
227  DOMString headers() const;
228 
229  /**
230  * see headers
231  */
232  void setHeaders(const DOMString &);
233 
234  /**
235  * Cell height. See the <a
236  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-height-TH">
237  * height attribute definition </a> in HTML 4.0. This attribute is
238  * deprecated in HTML 4.0.
239  *
240  */
241  DOMString height() const;
242 
243  /**
244  * see height
245  */
246  void setHeight(const DOMString &);
247 
248  /**
249  * Suppress word wrapping. See the <a
250  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-nowrap">
251  * nowrap attribute definition </a> in HTML 4.0. This attribute is
252  * deprecated in HTML 4.0.
253  *
254  */
255  bool noWrap() const;
256 
257  /**
258  * see noWrap
259  */
260  void setNoWrap(bool);
261 
262  /**
263  * Number of rows spanned by cell. See the <a
264  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-rowspan">
265  * rowspan attribute definition </a> in HTML 4.0.
266  *
267  */
268  long rowSpan() const;
269 
270  /**
271  * see rowSpan
272  */
273  void setRowSpan(long);
274 
275  /**
276  * Scope covered by header cells. See the <a
277  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-scope">
278  * scope attribute definition </a> in HTML 4.0.
279  *
280  */
281  DOMString scope() const;
282 
283  /**
284  * see scope
285  */
286  void setScope(const DOMString &);
287 
288  /**
289  * Vertical alignment of data in cell. See the <a
290  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-valign">
291  * valign attribute definition </a> in HTML 4.0.
292  *
293  */
294  DOMString vAlign() const;
295 
296  /**
297  * see vAlign
298  */
299  void setVAlign(const DOMString &);
300 
301  /**
302  * Cell width. See the <a
303  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-TH">
304  * width attribute definition </a> in HTML 4.0. This attribute is
305  * deprecated in HTML 4.0.
306  *
307  */
308  DOMString width() const;
309 
310  /**
311  * see width
312  */
313  void setWidth(const DOMString &);
314 };
315 
316 // --------------------------------------------------------------------------
317 
318 class HTMLTableColElementImpl;
319 
320 /**
321  * Regroups the \c COL and \c COLGROUP
322  * elements. See the <a
323  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#edef-COL">
324  * COL element definition </a> in HTML 4.0.
325  *
326  */
327 class KHTML_EXPORT HTMLTableColElement : public HTMLElement
328 {
329  friend class HTMLTableElement;
330 
331 public:
334  HTMLTableColElement(const Node &other) : HTMLElement()
335  {
336  (*this) = other;
337  }
338 protected:
339  HTMLTableColElement(HTMLTableColElementImpl *impl);
340 public:
341 
342  HTMLTableColElement &operator = (const HTMLTableColElement &other);
343  HTMLTableColElement &operator = (const Node &other);
344 
346 
347  /**
348  * Horizontal alignment of cell data in column. See the <a
349  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TD">
350  * align attribute definition </a> in HTML 4.0.
351  *
352  */
353  DOMString align() const;
354 
355  /**
356  * see align
357  */
358  void setAlign(const DOMString &);
359 
360  /**
361  * Alignment character for cells in a column. See the <a
362  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
363  * char attribute definition </a> in HTML 4.0.
364  *
365  */
366  DOMString ch() const;
367 
368  /**
369  * see ch
370  */
371  void setCh(const DOMString &);
372 
373  /**
374  * Offset of alignment character. See the <a
375  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
376  * charoff attribute definition </a> in HTML 4.0.
377  *
378  */
379  DOMString chOff() const;
380 
381  /**
382  * see chOff
383  */
384  void setChOff(const DOMString &);
385 
386  /**
387  * Indicates the number of columns in a group or affected by a
388  * grouping. See the <a
389  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-span-COL">
390  * span attribute definition </a> in HTML 4.0.
391  *
392  */
393  long span() const;
394 
395  /**
396  * see span
397  */
398  void setSpan(long);
399 
400  /**
401  * Vertical alignment of cell data in column. See the <a
402  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-valign">
403  * valign attribute definition </a> in HTML 4.0.
404  *
405  */
406  DOMString vAlign() const;
407 
408  /**
409  * see vAlign
410  */
411  void setVAlign(const DOMString &);
412 
413  /**
414  * Default column width. See the <a
415  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-COL">
416  * width attribute definition </a> in HTML 4.0.
417  *
418  */
419  DOMString width() const;
420 
421  /**
422  * see width
423  */
424  void setWidth(const DOMString &);
425 };
426 
427 // --------------------------------------------------------------------------
428 
429 class HTMLTableElementImpl;
430 class HTMLCollection;
433 class HTMLElement;
434 class DOMString;
435 
436 /**
437  * The create* and delete* methods on the table allow authors to
438  * construct and modify tables. HTML 4.0 specifies that only one of
439  * each of the \c CAPTION , \c THEAD , and
440  * \c TFOOT elements may exist in a table. Therefore, if
441  * one exists, and the createTHead() or createTFoot() method is
442  * called, the method returns the existing THead or TFoot element. See
443  * the <a
444  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#edef-TABLE">
445  * TABLE element definition </a> in HTML 4.0.
446  *
447  */
448 class KHTML_EXPORT HTMLTableElement : public HTMLElement
449 {
450 public:
452  HTMLTableElement(const HTMLTableElement &other);
453  HTMLTableElement(const Node &other) : HTMLElement()
454  {
455  (*this) = other;
456  }
457 
458 protected:
459  HTMLTableElement(HTMLTableElementImpl *impl);
460 public:
461 
462  HTMLTableElement &operator = (const HTMLTableElement &other);
463  HTMLTableElement &operator = (const Node &other);
464 
465  ~HTMLTableElement();
466 
467  /**
468  * Returns the table's \c CAPTION , or void if none
469  * exists.
470  *
471  */
472  HTMLTableCaptionElement caption() const;
473 
474  /**
475  * see caption
476  */
477  void setCaption(const HTMLTableCaptionElement &);
478 
479  /**
480  * Returns the table's \c THEAD , or \c null
481  * if none exists.
482  *
483  */
484  HTMLTableSectionElement tHead() const;
485 
486  /**
487  * see tHead
488  */
489  void setTHead(const HTMLTableSectionElement &);
490 
491  /**
492  * Returns the table's \c TFOOT , or \c null
493  * if none exists.
494  *
495  */
496  HTMLTableSectionElement tFoot() const;
497 
498  /**
499  * see tFoot
500  */
501  void setTFoot(const HTMLTableSectionElement &);
502 
503  /**
504  * Returns a collection of all the rows in the table, including
505  * all in \c THEAD , \c TFOOT , all
506  * \c TBODY elements.
507  *
508  */
509  HTMLCollection rows() const;
510 
511  /**
512  * Returns a collection of the table bodies (including implicit ones).
513  *
514  */
515  HTMLCollection tBodies() const;
516 
517  /**
518  * Specifies the table's position with respect to the rest of the
519  * document. See the <a
520  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TABLE">
521  * align attribute definition </a> in HTML 4.0. This attribute is
522  * deprecated in HTML 4.0.
523  *
524  */
525  DOMString align() const;
526 
527  /**
528  * see align
529  */
530  void setAlign(const DOMString &);
531 
532  /**
533  * Cell background color. See the <a
534  * href="https://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
535  * bgcolor attribute definition </a> in HTML 4.0. This attribute
536  * is deprecated in HTML 4.0.
537  *
538  */
539  DOMString bgColor() const;
540 
541  /**
542  * see bgColor
543  */
544  void setBgColor(const DOMString &);
545 
546  /**
547  * The width of the border around the table. See the <a
548  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-border-TABLE">
549  * border attribute definition </a> in HTML 4.0.
550  *
551  */
552  DOMString border() const;
553 
554  /**
555  * see border
556  */
557  void setBorder(const DOMString &);
558 
559  /**
560  * Specifies the horizontal and vertical space between cell
561  * content and cell borders. See the <a
562  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellpadding">
563  * cellpadding attribute definition </a> in HTML 4.0.
564  *
565  */
566  DOMString cellPadding() const;
567 
568  /**
569  * see cellPadding
570  */
571  void setCellPadding(const DOMString &);
572 
573  /**
574  * Specifies the horizontal and vertical separation between cells.
575  * See the <a
576  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-cellspacing">
577  * cellspacing attribute definition </a> in HTML 4.0.
578  *
579  */
580  DOMString cellSpacing() const;
581 
582  /**
583  * see cellSpacing
584  */
585  void setCellSpacing(const DOMString &);
586 
587  /**
588  * Specifies which external table borders to render. See the <a
589  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-frame">
590  * frame attribute definition </a> in HTML 4.0.
591  *
592  */
593  DOMString frame() const;
594 
595  /**
596  * see frame
597  */
598  void setFrame(const DOMString &);
599 
600  /**
601  * Specifies which internal table borders to render. See the <a
602  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-rules">
603  * rules attribute definition </a> in HTML 4.0.
604  *
605  */
606  DOMString rules() const;
607 
608  /**
609  * see rules
610  */
611  void setRules(const DOMString &);
612 
613  /**
614  * Supplementary description about the purpose or structure of a
615  * table. See the <a
616  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-summary">
617  * summary attribute definition </a> in HTML 4.0.
618  *
619  */
620  DOMString summary() const;
621 
622  /**
623  * see summary
624  */
625  void setSummary(const DOMString &);
626 
627  /**
628  * Specifies the desired table width. See the <a
629  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-width-TABLE">
630  * width attribute definition </a> in HTML 4.0.
631  *
632  */
633  DOMString width() const;
634 
635  /**
636  * see width
637  */
638  void setWidth(const DOMString &);
639 
640  /**
641  * Create a table header row or return an existing one.
642  *
643  * @return A new table header element ( \c THEAD ).
644  *
645  */
646  HTMLElement createTHead();
647 
648  /**
649  * Delete the header from the table, if one exists.
650  *
651  * @return
652  *
653  */
654  void deleteTHead();
655 
656  /**
657  * Create a table footer row or return an existing one.
658  *
659  * @return A footer element ( \c TFOOT ).
660  *
661  */
662  HTMLElement createTFoot();
663 
664  /**
665  * Delete the footer from the table, if one exists.
666  *
667  * @return
668  *
669  */
670  void deleteTFoot();
671 
672  /**
673  * Create a new table caption object or return an existing one.
674  *
675  * @return A \c CAPTION element.
676  *
677  */
678  HTMLElement createCaption();
679 
680  /**
681  * Delete the table caption, if one exists.
682  *
683  * @return
684  *
685  */
686  void deleteCaption();
687 
688  /**
689  * Insert a new empty row in the table.
690  * The new row is inserted immediately before and in the same section
691  * as the current indexth row in the table. If index is -1 or equal
692  * to the number of rows, the new row is appended. In addition, when
693  * the table is empty the row is inserted into a TBODY which is created
694  * and inserted into the table.
695  * Note. A table row cannot
696  * be empty according to HTML 4.0 Recommendation.
697  *
698  * @param index The row number where to insert a new row.
699  * The index starts from 0 and is relative to the logical order
700  * (not document order) of all the rows contained inside the table.
701  *
702  * @return The newly created row.
703  *
704  */
705  HTMLElement insertRow(long index);
706 
707  /**
708  * Delete a table row.
709  *
710  * @param index The index of the row to be deleted.
711  * This index starts from 0 and is relative to the logical order
712  * (not document order) of all the rows contained inside the table.
713  * If the index is -1 the last row in the table is deleted.
714  *
715  * @return
716  *
717  */
718  void deleteRow(long index);
719 };
720 
721 // --------------------------------------------------------------------------
722 
723 class HTMLTableRowElementImpl;
724 class HTMLCollection;
725 class HTMLElement;
726 class DOMString;
727 
728 /**
729  * A row in a table. See the <a
730  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#edef-TR">
731  * TR element definition </a> in HTML 4.0.
732  *
733  */
734 class KHTML_EXPORT HTMLTableRowElement : public HTMLElement
735 {
736  friend class HTMLTableElement;
737 
738 public:
741  HTMLTableRowElement(const Node &other) : HTMLElement()
742  {
743  (*this) = other;
744  }
745 
746 protected:
747  HTMLTableRowElement(HTMLTableRowElementImpl *impl);
748 public:
749 
750  HTMLTableRowElement &operator = (const HTMLTableRowElement &other);
751  HTMLTableRowElement &operator = (const Node &other);
752 
754 
755  /**
756  * The index of this row, relative to the entire table.
757  * This is in logical order and not in document order.
758  * The rowIndex does take into account sections
759  * (THEAD, TFOOT or TBODY) within the table,
760  * placing THEAD rows first in the index, followed by
761  * TBODY rows, followed by TFOOT rows.
762  */
763  long rowIndex() const;
764 
765  /**
766  * see rowIndex
767  *
768  * This function is obsolete - the rowIndex property is actually supposed to be read-only
769  * (https://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
770  */
771  void setRowIndex(long);
772 
773  /**
774  * The index of this row, relative to the current section (
775  * \c THEAD , \c TFOOT , or \c TBODY
776  * ).
777  *
778  */
779  long sectionRowIndex() const;
780 
781  /**
782  * see sectionRowIndex
783  *
784  * This function is obsolete - the sectionRowIndex property is actually supposed to be read-only
785  * (https://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
786  */
787  void setSectionRowIndex(long);
788 
789  /**
790  * The collection of cells in this row.
791  *
792  */
793  HTMLCollection cells() const;
794 
795  /**
796  * see cells
797  *
798  * This function is obsolete - the cells property is actually supposed to be read-only
799  * (https://www.w3.org/DOM/updates/REC-DOM-Level-1-19981001-errata.html)
800  */
801  void setCells(const HTMLCollection &);
802 
803  /**
804  * Horizontal alignment of data within cells of this row. See the
805  * <a
806  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-align-TD">
807  * align attribute definition </a> in HTML 4.0.
808  *
809  */
810  DOMString align() const;
811 
812  /**
813  * see align
814  */
815  void setAlign(const DOMString &);
816 
817  /**
818  * Background color for rows. See the <a
819  * href="https://www.w3.org/TR/REC-html40/present/graphics.html#adef-bgcolor">
820  * bgcolor attribute definition </a> in HTML 4.0. This attribute
821  * is deprecated in HTML 4.0.
822  *
823  */
824  DOMString bgColor() const;
825 
826  /**
827  * see bgColor
828  */
829  void setBgColor(const DOMString &);
830 
831  /**
832  * Alignment character for cells in a column. See the <a
833  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
834  * char attribute definition </a> in HTML 4.0.
835  *
836  */
837  DOMString ch() const;
838 
839  /**
840  * see ch
841  */
842  void setCh(const DOMString &);
843 
844  /**
845  * Offset of alignment character. See the <a
846  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
847  * charoff attribute definition </a> in HTML 4.0.
848  *
849  */
850  DOMString chOff() const;
851 
852  /**
853  * see chOff
854  */
855  void setChOff(const DOMString &);
856 
857  /**
858  * Vertical alignment of data within cells of this row. See the <a
859  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-valign">
860  * valign attribute definition </a> in HTML 4.0.
861  *
862  */
863  DOMString vAlign() const;
864 
865  /**
866  * see vAlign
867  */
868  void setVAlign(const DOMString &);
869 
870  /**
871  * Insert an empty \c TD cell into this row.
872  * If index is -1 or equal to the number of cells, the new
873  * cell is appended.
874  *
875  * @param index The place to insert the cell.
876  *
877  * @return The newly created cell.
878  *
879  */
880  HTMLElement insertCell(long index);
881 
882  /**
883  * Delete a cell from the current row.
884  *
885  * @param index The index of the cell to delete, starting from 0.
886  * If the index is -1 the last cell in the row is deleted.
887  *
888  * @return
889  *
890  */
891  void deleteCell(long index);
892 };
893 
894 // --------------------------------------------------------------------------
895 
896 class HTMLTableSectionElementImpl;
897 class HTMLCollection;
898 class HTMLElement;
899 class DOMString;
900 
901 /**
902  * The \c THEAD , \c TFOOT , and \c TBODY
903  * elements.
904  *
905  */
906 class KHTML_EXPORT HTMLTableSectionElement : public HTMLElement
907 {
908  friend class HTMLTableElement;
909 
910 public:
913  HTMLTableSectionElement(const Node &other) : HTMLElement()
914  {
915  (*this) = other;
916  }
917 
918 protected:
919  HTMLTableSectionElement(HTMLTableSectionElementImpl *impl);
920 public:
921 
922  HTMLTableSectionElement &operator = (const HTMLTableSectionElement &other);
923  HTMLTableSectionElement &operator = (const Node &other);
924 
926 
927  /**
928  * Horizontal alignment of data in cells. See the \c align
929  * attribute for HTMLTheadElement for details.
930  *
931  */
932  DOMString align() const;
933 
934  /**
935  * see align
936  */
937  void setAlign(const DOMString &);
938 
939  /**
940  * Alignment character for cells in a column. See the <a
941  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-char">
942  * char attribute definition </a> in HTML 4.0.
943  *
944  */
945  DOMString ch() const;
946 
947  /**
948  * see ch
949  */
950  void setCh(const DOMString &);
951 
952  /**
953  * Offset of alignment character. See the <a
954  * href="https://www.w3.org/TR/REC-html40/struct/tables.html#adef-charoff">
955  * charoff attribute definition </a> in HTML 4.0.
956  *
957  */
958  DOMString chOff() const;
959 
960  /**
961  * see chOff
962  */
963  void setChOff(const DOMString &);
964 
965  /**
966  * Vertical alignment of data in cells. See the \c valign
967  * attribute for HTMLTheadElement for details.
968  *
969  */
970  DOMString vAlign() const;
971 
972  /**
973  * see vAlign
974  */
975  void setVAlign(const DOMString &);
976 
977  /**
978  * The collection of rows in this table section.
979  *
980  */
981  HTMLCollection rows() const;
982 
983  /**
984  * Insert a row into this section.
985  * The new row is inserted immediately before the current indexth
986  * row in this section. If index is -1 or equal to the number of rows
987  * in this sectino, the new row is appended.
988  *
989  * @param index The row number where to insert a new row.
990  *
991  * @return The newly created row.
992  *
993  */
994  HTMLElement insertRow(long index);
995 
996  /**
997  * Delete a row from this section.
998  *
999  * @param index The index of the row to be deleted,
1000  * or -1 to delete the last row. This index starts from 0 and is relative only
1001  * to the rows contained inside this section, not all the rows in the table.
1002  *
1003  */
1004  void deleteRow(long index);
1005 };
1006 
1007 } //namespace
1008 
1009 #endif
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:278
Table caption See the CAPTION element definition in HTML 4.0.
Definition: html_table.h:48
The THEAD , TFOOT , and TBODY elements.
Definition: html_table.h:906
The object used to represent the TH and TD elements.
Definition: html_table.h:94
Regroups the COL and COLGROUP elements.
Definition: html_table.h:327
An HTMLCollection is a list of nodes.
Definition: html_misc.h:133
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
This library provides a full-featured HTML parser and widget.
A row in a table.
Definition: html_table.h:734
The create* and delete* methods on the table allow authors to construct and modify tables...
Definition: html_table.h:448
All HTML element interfaces derive from this class.
Definition: html_element.h:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 22:46:08 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.