]>
git.saurik.com Git - wxWidgets.git/blob - src/html/m_tables.cpp
6c9d5062d54b212b2954adeebe9aee1d0463ccf0
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtml module for tables
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
10 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
11 #pragma implementation
14 #include "wx/wxprec.h"
17 #if wxUSE_HTML && wxUSE_STREAMS
25 #include "wx/html/forcelnk.h"
26 #include "wx/html/m_templ.h"
28 #include "wx/html/htmlcell.h"
30 FORCE_LINK_ME(m_tables
)
33 #define TABLE_BORDER_CLR_1 wxColour(0xC5, 0xC2, 0xC5)
34 #define TABLE_BORDER_CLR_2 wxColour(0x62, 0x61, 0x62)
37 //-----------------------------------------------------------------------------
39 //-----------------------------------------------------------------------------
45 // width of the column either in pixels or percents
46 // ('width' is the number, 'units' determines its meaning)
47 int minWidth
, maxWidth
;
48 // minimal/maximal column width. This is needed by HTML 4.0
49 // layouting algorithm and can be determined by trying to
50 // layout table cells with width=1 and width=infinity
51 int leftpos
, pixwidth
, maxrealwidth
;
52 // temporary (depends on actual width of table)
64 wxHtmlContainerCell
*cont
;
66 int minheight
, valign
;
72 class wxHtmlTableCell
: public wxHtmlContainerCell
75 /* These are real attributes: */
77 // should we draw borders or not?
79 // number of columns; rows
80 int m_NumCols
, m_NumRows
;
81 // array of column information
82 colStruct
*m_ColsInfo
;
83 // 2D array of all cells in the table : m_CellInfo[row][column]
84 cellStruct
**m_CellInfo
;
85 // spaces between cells
87 // cells internal indentation
91 /* ...and these are valid only when parsing the table: */
93 // number of actual column (ranging from 0..m_NumCols)
94 int m_ActualCol
, m_ActualRow
;
96 // default values (for table and row):
97 wxColour m_tBkg
, m_rBkg
;
98 wxString m_tValign
, m_rValign
;
104 wxHtmlTableCell(wxHtmlContainerCell
*parent
, const wxHtmlTag
& tag
, double pixel_scale
= 1.0);
106 virtual void Layout(int w
);
108 void AddRow(const wxHtmlTag
& tag
);
109 void AddCell(wxHtmlContainerCell
*cell
, const wxHtmlTag
& tag
);
112 // Reallocates memory to given number of cols/rows
113 // and changes m_NumCols/m_NumRows value to reflect this change
114 // NOTE! You CAN'T change m_NumCols/m_NumRows before calling this!!
115 void ReallocCols(int cols
);
116 void ReallocRows(int rows
);
118 // Computes minimal and maximal widths of columns. Needs to be called
119 // only once, before first Layout().
120 void ComputeMinMaxWidths();
122 DECLARE_NO_COPY_CLASS(wxHtmlTableCell
)
127 wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell
*parent
, const wxHtmlTag
& tag
, double pixel_scale
)
128 : wxHtmlContainerCell(parent
)
130 m_PixelScale
= pixel_scale
;
132 (tag
.HasParam(wxT("BORDER")) && tag
.GetParam(wxT("BORDER")) != wxT("0"));
134 m_NumCols
= m_NumRows
= 0;
136 m_ActualCol
= m_ActualRow
= -1;
139 if (tag
.HasParam(wxT("BGCOLOR")))
140 tag
.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg
);
141 if (tag
.HasParam(wxT("VALIGN")))
142 m_tValign
= tag
.GetParam(wxT("VALIGN"));
144 m_tValign
= wxEmptyString
;
145 if (!tag
.GetParamAsInt(wxT("CELLSPACING"), &m_Spacing
))
147 if (!tag
.GetParamAsInt(wxT("CELLPADDING"), &m_Padding
))
149 m_Spacing
= (int)(m_PixelScale
* (double)m_Spacing
);
150 m_Padding
= (int)(m_PixelScale
* (double)m_Padding
);
153 SetBorder(TABLE_BORDER_CLR_1
, TABLE_BORDER_CLR_2
);
158 wxHtmlTableCell::~wxHtmlTableCell()
160 if (m_ColsInfo
) free(m_ColsInfo
);
163 for (int i
= 0; i
< m_NumRows
; i
++)
171 void wxHtmlTableCell::ReallocCols(int cols
)
175 for (i
= 0; i
< m_NumRows
; i
++)
177 m_CellInfo
[i
] = (cellStruct
*) realloc(m_CellInfo
[i
], sizeof(cellStruct
) * cols
);
178 for (j
= m_NumCols
; j
< cols
; j
++)
179 m_CellInfo
[i
][j
].flag
= cellFree
;
182 m_ColsInfo
= (colStruct
*) realloc(m_ColsInfo
, sizeof(colStruct
) * cols
);
183 for (j
= m_NumCols
; j
< cols
; j
++)
185 m_ColsInfo
[j
].width
= 0;
186 m_ColsInfo
[j
].units
= wxHTML_UNITS_PERCENT
;
187 m_ColsInfo
[j
].minWidth
= m_ColsInfo
[j
].maxWidth
= -1;
195 void wxHtmlTableCell::ReallocRows(int rows
)
197 m_CellInfo
= (cellStruct
**) realloc(m_CellInfo
, sizeof(cellStruct
*) * rows
);
198 for (int row
= m_NumRows
; row
< rows
; row
++)
201 m_CellInfo
[row
] = NULL
;
204 m_CellInfo
[row
] = (cellStruct
*) malloc(sizeof(cellStruct
) * m_NumCols
);
205 for (int col
= 0; col
< m_NumCols
; col
++)
206 m_CellInfo
[row
][col
].flag
= cellFree
;
213 void wxHtmlTableCell::AddRow(const wxHtmlTag
& tag
)
216 // VS: real allocation of row entry is done in AddCell in order
217 // to correctly handle empty rows (i.e. "<tr></tr>")
218 // m_ActualCol == -1 indicates that AddCell has to allocate new row.
222 if (tag
.HasParam(wxT("BGCOLOR")))
223 tag
.GetParamAsColour(wxT("BGCOLOR"), &m_rBkg
);
224 if (tag
.HasParam(wxT("VALIGN")))
225 m_rValign
= tag
.GetParam(wxT("VALIGN"));
227 m_rValign
= m_tValign
;
232 void wxHtmlTableCell::AddCell(wxHtmlContainerCell
*cell
, const wxHtmlTag
& tag
)
234 // Is this cell in new row?
235 // VS: we can't do it in AddRow, see my comment there
236 if (m_ActualCol
== -1)
238 if (m_ActualRow
+ 1 > m_NumRows
- 1)
239 ReallocRows(m_ActualRow
+ 2);
247 } while ((m_ActualCol
< m_NumCols
) &&
248 (m_CellInfo
[m_ActualRow
][m_ActualCol
].flag
!= cellFree
));
250 if (m_ActualCol
> m_NumCols
- 1)
251 ReallocCols(m_ActualCol
+ 1);
253 int r
= m_ActualRow
, c
= m_ActualCol
;
255 m_CellInfo
[r
][c
].cont
= cell
;
256 m_CellInfo
[r
][c
].colspan
= 1;
257 m_CellInfo
[r
][c
].rowspan
= 1;
258 m_CellInfo
[r
][c
].flag
= cellUsed
;
259 m_CellInfo
[r
][c
].minheight
= 0;
260 m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_TOP
;
262 /* scan for parameters: */
266 if (tag
.HasParam(wxT("WIDTH")))
268 wxString wd
= tag
.GetParam(wxT("WIDTH"));
270 if (wd
[wd
.Length()-1] == wxT('%'))
272 wxSscanf(wd
.c_str(), wxT("%i%%"), &m_ColsInfo
[c
].width
);
273 m_ColsInfo
[c
].units
= wxHTML_UNITS_PERCENT
;
277 wxSscanf(wd
.c_str(), wxT("%i"), &m_ColsInfo
[c
].width
);
278 m_ColsInfo
[c
].width
= (int)(m_PixelScale
* (double)m_ColsInfo
[c
].width
);
279 m_ColsInfo
[c
].units
= wxHTML_UNITS_PIXELS
;
287 tag
.GetParamAsInt(wxT("COLSPAN"), &m_CellInfo
[r
][c
].colspan
);
288 tag
.GetParamAsInt(wxT("ROWSPAN"), &m_CellInfo
[r
][c
].rowspan
);
290 // VS: the standard says this about col/rowspan:
291 // "This attribute specifies the number of rows spanned by the
292 // current cell. The default value of this attribute is one ("1").
293 // The value zero ("0") means that the cell spans all rows from the
294 // current row to the last row of the table." All mainstream
295 // browsers act as if 0==1, though, and so does wxHTML.
296 if (m_CellInfo
[r
][c
].colspan
< 1)
297 m_CellInfo
[r
][c
].colspan
= 1;
298 if (m_CellInfo
[r
][c
].rowspan
< 1)
299 m_CellInfo
[r
][c
].rowspan
= 1;
301 if ((m_CellInfo
[r
][c
].colspan
> 1) || (m_CellInfo
[r
][c
].rowspan
> 1))
305 if (r
+ m_CellInfo
[r
][c
].rowspan
> m_NumRows
)
306 ReallocRows(r
+ m_CellInfo
[r
][c
].rowspan
);
307 if (c
+ m_CellInfo
[r
][c
].colspan
> m_NumCols
)
308 ReallocCols(c
+ m_CellInfo
[r
][c
].colspan
);
309 for (i
= r
; i
< r
+ m_CellInfo
[r
][c
].rowspan
; i
++)
310 for (j
= c
; j
< c
+ m_CellInfo
[r
][c
].colspan
; j
++)
311 m_CellInfo
[i
][j
].flag
= cellSpan
;
312 m_CellInfo
[r
][c
].flag
= cellUsed
;
318 wxColour bk
= m_rBkg
;
319 if (tag
.HasParam(wxT("BGCOLOR")))
320 tag
.GetParamAsColour(wxT("BGCOLOR"), &bk
);
322 cell
->SetBackgroundColour(bk
);
325 cell
->SetBorder(TABLE_BORDER_CLR_2
, TABLE_BORDER_CLR_1
);
327 // vertical alignment:
330 if (tag
.HasParam(wxT("VALIGN")))
331 valign
= tag
.GetParam(wxT("VALIGN"));
335 if (valign
== wxT("TOP"))
336 m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_TOP
;
337 else if (valign
== wxT("BOTTOM"))
338 m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_BOTTOM
;
339 else m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_CENTER
;
343 if (tag
.HasParam(wxT("NOWRAP")))
344 m_CellInfo
[r
][c
].nowrap
= true;
346 m_CellInfo
[r
][c
].nowrap
= false;
348 cell
->SetIndent(m_Padding
, wxHTML_INDENT_ALL
, wxHTML_UNITS_PIXELS
);
351 void wxHtmlTableCell::ComputeMinMaxWidths()
353 if (m_NumCols
== 0 || m_ColsInfo
[0].minWidth
!= -1) return;
357 for (int c
= 0; c
< m_NumCols
; c
++)
359 for (int r
= 0; r
< m_NumRows
; r
++)
361 cellStruct
& cell
= m_CellInfo
[r
][c
];
362 if (cell
.flag
== cellUsed
)
364 cell
.cont
->Layout(2*m_Padding
+ 1);
365 int maxWidth
= cell
.cont
->GetMaxTotalWidth();
366 int width
= cell
.nowrap
?maxWidth
:cell
.cont
->GetWidth();
367 width
-= (cell
.colspan
-1) * m_Spacing
;
368 maxWidth
-= (cell
.colspan
-1) * m_Spacing
;
369 // HTML 4.0 says it is acceptable to distribute min/max
370 width
/= cell
.colspan
;
371 maxWidth
/= cell
.colspan
;
372 for (int j
= 0; j
< cell
.colspan
; j
++) {
373 if (width
> m_ColsInfo
[c
+j
].minWidth
)
374 m_ColsInfo
[c
+j
].minWidth
= width
;
375 if (maxWidth
> m_ColsInfo
[c
+j
].maxWidth
)
376 m_ColsInfo
[c
+j
].maxWidth
= maxWidth
;
380 // Calculate maximum table width, required for nested tables
381 if (m_ColsInfo
[c
].units
== wxHTML_UNITS_PIXELS
)
382 m_MaxTotalWidth
+= wxMax(m_ColsInfo
[c
].width
, m_ColsInfo
[c
].minWidth
);
383 else if ((m_ColsInfo
[c
].units
== wxHTML_UNITS_PERCENT
) && (m_ColsInfo
[c
].width
!= 0))
384 percentage
+= m_ColsInfo
[c
].width
;
386 m_MaxTotalWidth
+= m_ColsInfo
[c
].maxWidth
;
389 if (percentage
>= 100)
391 // Table would have infinite length
392 // Make it ridiculous large
393 m_MaxTotalWidth
= 0xFFFFFF;
396 m_MaxTotalWidth
= m_MaxTotalWidth
* 100 / (100 - percentage
);
398 m_MaxTotalWidth
+= (m_NumCols
+ 1) * m_Spacing
;
401 void wxHtmlTableCell::Layout(int w
)
403 ComputeMinMaxWidths();
405 wxHtmlCell::Layout(w
);
413 if (m_WidthFloatUnits
== wxHTML_UNITS_PERCENT
)
415 if (m_WidthFloat
< 0)
417 if (m_WidthFloat
< -100)
419 m_Width
= (100 + m_WidthFloat
) * w
/ 100;
423 if (m_WidthFloat
> 100)
425 m_Width
= m_WidthFloat
* w
/ 100;
430 if (m_WidthFloat
< 0) m_Width
= w
+ m_WidthFloat
;
431 else m_Width
= m_WidthFloat
;
441 /* 1. setup columns widths:
443 The algorithm tries to keep the table size less than w if possible.
446 int wpix
= m_Width
- (m_NumCols
+ 1) * m_Spacing
;
449 // 1a. setup fixed-width columns:
450 for (i
= 0; i
< m_NumCols
; i
++)
451 if (m_ColsInfo
[i
].units
== wxHTML_UNITS_PIXELS
)
453 m_ColsInfo
[i
].pixwidth
= wxMax(m_ColsInfo
[i
].width
,
454 m_ColsInfo
[i
].minWidth
);
455 wpix
-= m_ColsInfo
[i
].pixwidth
;
458 // 1b. Calculate maximum possible width if line wrapping would be disabled
459 // Recalculate total width if m_WidthFloat is zero to keep tables as small
462 for (i
= 0; i
< m_NumCols
; i
++)
463 if (m_ColsInfo
[i
].width
== 0)
465 maxWidth
+= m_ColsInfo
[i
].maxWidth
;
470 // Recalculate table width since no table width was initially given
471 int newWidth
= m_Width
- wpix
+ maxWidth
;
473 // Make sure that floating-width columns will have the right size.
474 // Calculate sum of all floating-width columns
476 for (i
= 0; i
< m_NumCols
; i
++)
477 if ((m_ColsInfo
[i
].units
== wxHTML_UNITS_PERCENT
) && (m_ColsInfo
[i
].width
!= 0))
478 percentage
+= m_ColsInfo
[i
].width
;
480 if (percentage
>= 100)
483 newWidth
= newWidth
* 100 / (100 - percentage
);
485 newWidth
= wxMin(newWidth
, w
- (m_NumCols
+ 1) * m_Spacing
);
486 wpix
-= m_Width
- newWidth
;
491 // 1c. setup floating-width columns:
493 for (i
= 0; i
< m_NumCols
; i
++)
494 if ((m_ColsInfo
[i
].units
== wxHTML_UNITS_PERCENT
) && (m_ColsInfo
[i
].width
!= 0))
496 m_ColsInfo
[i
].pixwidth
= wxMin(m_ColsInfo
[i
].width
, 100) * wpix
/ 100;
498 // Make sure to leave enough space for the other columns
500 for (j
= 0; j
< m_NumCols
; j
++)
502 if ((m_ColsInfo
[j
].units
== wxHTML_UNITS_PERCENT
&& j
> i
) ||
503 !m_ColsInfo
[j
].width
)
504 minRequired
+= m_ColsInfo
[j
].minWidth
;
506 m_ColsInfo
[i
].pixwidth
= wxMax(wxMin(wtemp
- minRequired
, m_ColsInfo
[i
].pixwidth
), m_ColsInfo
[i
].minWidth
);
508 wtemp
-= m_ColsInfo
[i
].pixwidth
;
512 // 1d. setup default columns (no width specification supplied):
513 // The algorithm assigns calculates the maximum possible width if line
514 // wrapping would be disabled and assigns column width as a fraction
515 // based upon the maximum width of a column
516 // FIXME: I'm not sure if this algorithm is conform to HTML standard,
517 // though it seems to be much better than the old one
519 for (i
= j
= 0; i
< m_NumCols
; i
++)
520 if (m_ColsInfo
[i
].width
== 0) j
++;
525 for (i
= 0; i
< m_NumCols
; i
++)
526 if (m_ColsInfo
[i
].width
== 0)
528 // Assign with, make sure not to drop below minWidth
530 m_ColsInfo
[i
].pixwidth
= (int)(wpix
* (m_ColsInfo
[i
].maxWidth
/ (float)maxWidth
) + 0.5);
532 m_ColsInfo
[i
].pixwidth
= wpix
/ j
;
534 // Make sure to leave enough space for the other columns
537 for (r
= i
+ 1; r
< m_NumCols
; r
++)
539 if (!m_ColsInfo
[r
].width
)
540 minRequired
+= m_ColsInfo
[r
].minWidth
;
542 m_ColsInfo
[i
].pixwidth
= wxMax(wxMin(wpix
- minRequired
, m_ColsInfo
[i
].pixwidth
), m_ColsInfo
[i
].minWidth
);
546 if (m_ColsInfo
[i
].pixwidth
> (wpix
* (m_ColsInfo
[i
].maxWidth
/ (float)maxWidth
) + 0.5))
548 int diff
= (int)(m_ColsInfo
[i
].pixwidth
- (wpix
* m_ColsInfo
[i
].maxWidth
/ (float)maxWidth
+ 0.5));
549 maxWidth
+= diff
- m_ColsInfo
[i
].maxWidth
;
552 maxWidth
-= m_ColsInfo
[i
].maxWidth
;
554 wpix
-= m_ColsInfo
[i
].pixwidth
;
558 /* 2. compute positions of columns: */
560 int wpos
= m_Spacing
;
561 for (int i
= 0; i
< m_NumCols
; i
++)
563 m_ColsInfo
[i
].leftpos
= wpos
;
564 wpos
+= m_ColsInfo
[i
].pixwidth
+ m_Spacing
;
568 /* 3. sub-layout all cells: */
570 int *ypos
= new int[m_NumRows
+ 1];
574 wxHtmlContainerCell
*actcell
;
577 for (actrow
= 1; actrow
<= m_NumRows
; actrow
++) ypos
[actrow
] = -1;
578 for (actrow
= 0; actrow
< m_NumRows
; actrow
++)
580 if (ypos
[actrow
] == -1) ypos
[actrow
] = ypos
[actrow
-1];
581 // 3a. sub-layout and detect max height:
583 for (actcol
= 0; actcol
< m_NumCols
; actcol
++) {
584 if (m_CellInfo
[actrow
][actcol
].flag
!= cellUsed
) continue;
585 actcell
= m_CellInfo
[actrow
][actcol
].cont
;
587 for (int i
= actcol
; i
< m_CellInfo
[actrow
][actcol
].colspan
+ actcol
; i
++)
588 fullwid
+= m_ColsInfo
[i
].pixwidth
;
589 fullwid
+= (m_CellInfo
[actrow
][actcol
].colspan
- 1) * m_Spacing
;
590 actcell
->SetMinHeight(m_CellInfo
[actrow
][actcol
].minheight
, m_CellInfo
[actrow
][actcol
].valign
);
591 actcell
->Layout(fullwid
);
593 if (ypos
[actrow
] + actcell
->GetHeight() + m_CellInfo
[actrow
][actcol
].rowspan
* m_Spacing
> ypos
[actrow
+ m_CellInfo
[actrow
][actcol
].rowspan
])
594 ypos
[actrow
+ m_CellInfo
[actrow
][actcol
].rowspan
] =
595 ypos
[actrow
] + actcell
->GetHeight() + m_CellInfo
[actrow
][actcol
].rowspan
* m_Spacing
;
599 for (actrow
= 0; actrow
< m_NumRows
; actrow
++)
601 // 3b. place cells in row & let'em all have same height:
603 for (actcol
= 0; actcol
< m_NumCols
; actcol
++)
605 if (m_CellInfo
[actrow
][actcol
].flag
!= cellUsed
) continue;
606 actcell
= m_CellInfo
[actrow
][actcol
].cont
;
607 actcell
->SetMinHeight(
608 ypos
[actrow
+ m_CellInfo
[actrow
][actcol
].rowspan
] - ypos
[actrow
] - m_Spacing
,
609 m_CellInfo
[actrow
][actcol
].valign
);
611 for (int i
= actcol
; i
< m_CellInfo
[actrow
][actcol
].colspan
+ actcol
; i
++)
612 fullwid
+= m_ColsInfo
[i
].pixwidth
;
613 fullwid
+= (m_CellInfo
[actrow
][actcol
].colspan
- 1) * m_Spacing
;
614 actcell
->Layout(fullwid
);
615 actcell
->SetPos(m_ColsInfo
[actcol
].leftpos
, ypos
[actrow
]);
618 m_Height
= ypos
[m_NumRows
];
622 /* 4. adjust table's width if it was too small: */
625 int twidth
= m_ColsInfo
[m_NumCols
-1].leftpos
+
626 m_ColsInfo
[m_NumCols
-1].pixwidth
+ m_Spacing
;
627 if (twidth
> m_Width
)
637 //-----------------------------------------------------------------------------
638 // The tables handler:
639 //-----------------------------------------------------------------------------
642 TAG_HANDLER_BEGIN(TABLE
, "TABLE,TR,TD,TH")
645 wxHtmlTableCell
* m_Table
;
646 wxString m_tAlign
, m_rAlign
;
648 TAG_HANDLER_CONSTR(TABLE
)
651 m_tAlign
= m_rAlign
= wxEmptyString
;
655 TAG_HANDLER_PROC(tag
)
657 wxHtmlContainerCell
*c
;
659 // new table started, backup upper-level table (if any) and create new:
660 if (tag
.GetName() == wxT("TABLE"))
662 wxHtmlTableCell
*oldt
= m_Table
;
663 wxHtmlContainerCell
*oldcont
;
665 oldcont
= c
= m_WParser
->OpenContainer();
667 m_Table
= new wxHtmlTableCell(c
, tag
);
671 if (tag
.HasParam(wxT("WIDTH")))
673 wxString wd
= tag
.GetParam(wxT("WIDTH"));
675 if (wd
[wd
.Length()-1] == wxT('%'))
678 wxSscanf(wd
.c_str(), wxT("%i%%"), &width
);
679 m_Table
->SetWidthFloat(width
, wxHTML_UNITS_PERCENT
);
684 wxSscanf(wd
.c_str(), wxT("%i"), &width
);
685 m_Table
->SetWidthFloat((int)(m_WParser
->GetPixelScale() * width
), wxHTML_UNITS_PIXELS
);
689 m_Table
->SetWidthFloat(0, wxHTML_UNITS_PIXELS
);
691 int oldAlign
= m_WParser
->GetAlign();
692 m_tAlign
= wxEmptyString
;
693 if (tag
.HasParam(wxT("ALIGN")))
694 m_tAlign
= tag
.GetParam(wxT("ALIGN"));
698 m_WParser
->SetAlign(oldAlign
);
699 m_WParser
->SetContainer(oldcont
);
700 m_WParser
->CloseContainer();
710 if (tag
.GetName() == wxT("TR"))
712 m_Table
->AddRow(tag
);
714 if (tag
.HasParam(wxT("ALIGN")))
715 m_rAlign
= tag
.GetParam(wxT("ALIGN"));
721 c
= m_WParser
->SetContainer(new wxHtmlContainerCell(m_Table
));
722 m_Table
->AddCell(c
, tag
);
724 m_WParser
->OpenContainer();
726 if (tag
.GetName() == wxT("TH")) /*header style*/
727 m_WParser
->SetAlign(wxHTML_ALIGN_CENTER
);
729 m_WParser
->SetAlign(wxHTML_ALIGN_LEFT
);
734 if (tag
.HasParam(wxT("ALIGN")))
735 als
= tag
.GetParam(wxT("ALIGN"));
737 if (als
== wxT("RIGHT"))
738 m_WParser
->SetAlign(wxHTML_ALIGN_RIGHT
);
739 else if (als
== wxT("LEFT"))
740 m_WParser
->SetAlign(wxHTML_ALIGN_LEFT
);
741 else if (als
== wxT("CENTER"))
742 m_WParser
->SetAlign(wxHTML_ALIGN_CENTER
);
744 m_WParser
->OpenContainer();
750 TAG_HANDLER_END(TABLE
)
756 TAGS_MODULE_BEGIN(Tables
)
758 TAGS_MODULE_ADD(TABLE
)
760 TAGS_MODULE_END(Tables
)