]>
git.saurik.com Git - wxWidgets.git/blob - src/html/m_tables.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtml module for tables
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #include "wx/wxprec.h"
13 #if wxUSE_HTML && wxUSE_STREAMS
21 #include "wx/html/forcelnk.h"
22 #include "wx/html/m_templ.h"
24 #include "wx/html/htmlcell.h"
26 FORCE_LINK_ME(m_tables
)
29 #define TABLE_BORDER_CLR_1 wxColour(0xC5, 0xC2, 0xC5)
30 #define TABLE_BORDER_CLR_2 wxColour(0x62, 0x61, 0x62)
33 //-----------------------------------------------------------------------------
35 //-----------------------------------------------------------------------------
41 // width of the column either in pixels or percents
42 // ('width' is the number, 'units' determines its meaning)
43 int minWidth
, maxWidth
;
44 // minimal/maximal column width. This is needed by HTML 4.0
45 // layouting algorithm and can be determined by trying to
46 // layout table cells with width=1 and width=infinity
47 int leftpos
, pixwidth
, maxrealwidth
;
48 // temporary (depends on actual width of table)
60 wxHtmlContainerCell
*cont
;
62 int minheight
, valign
;
68 class wxHtmlTableCell
: public wxHtmlContainerCell
71 /* These are real attributes: */
73 // should we draw borders or not?
75 // number of columns; rows
76 int m_NumCols
, m_NumRows
;
77 // array of column information
78 colStruct
*m_ColsInfo
;
79 // 2D array of all cells in the table : m_CellInfo[row][column]
80 cellStruct
**m_CellInfo
;
81 // spaces between cells
83 // cells internal indentation
87 /* ...and these are valid only when parsing the table: */
89 // number of actual column (ranging from 0..m_NumCols)
90 int m_ActualCol
, m_ActualRow
;
92 // default values (for table and row):
93 wxColour m_tBkg
, m_rBkg
;
94 wxString m_tValign
, m_rValign
;
100 wxHtmlTableCell(wxHtmlContainerCell
*parent
, const wxHtmlTag
& tag
, double pixel_scale
= 1.0);
102 virtual void Layout(int w
);
104 void AddRow(const wxHtmlTag
& tag
);
105 void AddCell(wxHtmlContainerCell
*cell
, const wxHtmlTag
& tag
);
108 // Reallocates memory to given number of cols/rows
109 // and changes m_NumCols/m_NumRows value to reflect this change
110 // NOTE! You CAN'T change m_NumCols/m_NumRows before calling this!!
111 void ReallocCols(int cols
);
112 void ReallocRows(int rows
);
114 // Computes minimal and maximal widths of columns. Needs to be called
115 // only once, before first Layout().
116 void ComputeMinMaxWidths();
118 DECLARE_NO_COPY_CLASS(wxHtmlTableCell
)
123 wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell
*parent
, const wxHtmlTag
& tag
, double pixel_scale
)
124 : wxHtmlContainerCell(parent
)
126 m_PixelScale
= pixel_scale
;
128 (tag
.HasParam(wxT("BORDER")) && tag
.GetParam(wxT("BORDER")) != wxT("0"));
130 m_NumCols
= m_NumRows
= 0;
132 m_ActualCol
= m_ActualRow
= -1;
135 if (tag
.HasParam(wxT("BGCOLOR")))
136 tag
.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg
);
137 if (tag
.HasParam(wxT("VALIGN")))
138 m_tValign
= tag
.GetParam(wxT("VALIGN"));
140 m_tValign
= wxEmptyString
;
141 if (!tag
.GetParamAsInt(wxT("CELLSPACING"), &m_Spacing
))
143 if (!tag
.GetParamAsInt(wxT("CELLPADDING"), &m_Padding
))
145 m_Spacing
= (int)(m_PixelScale
* (double)m_Spacing
);
146 m_Padding
= (int)(m_PixelScale
* (double)m_Padding
);
149 SetBorder(TABLE_BORDER_CLR_1
, TABLE_BORDER_CLR_2
);
154 wxHtmlTableCell::~wxHtmlTableCell()
156 if (m_ColsInfo
) free(m_ColsInfo
);
159 for (int i
= 0; i
< m_NumRows
; i
++)
167 void wxHtmlTableCell::ReallocCols(int cols
)
171 for (i
= 0; i
< m_NumRows
; i
++)
173 m_CellInfo
[i
] = (cellStruct
*) realloc(m_CellInfo
[i
], sizeof(cellStruct
) * cols
);
174 for (j
= m_NumCols
; j
< cols
; j
++)
175 m_CellInfo
[i
][j
].flag
= cellFree
;
178 m_ColsInfo
= (colStruct
*) realloc(m_ColsInfo
, sizeof(colStruct
) * cols
);
179 for (j
= m_NumCols
; j
< cols
; j
++)
181 m_ColsInfo
[j
].width
= 0;
182 m_ColsInfo
[j
].units
= wxHTML_UNITS_PERCENT
;
183 m_ColsInfo
[j
].minWidth
= m_ColsInfo
[j
].maxWidth
= -1;
191 void wxHtmlTableCell::ReallocRows(int rows
)
193 m_CellInfo
= (cellStruct
**) realloc(m_CellInfo
, sizeof(cellStruct
*) * rows
);
194 for (int row
= m_NumRows
; row
< rows
; row
++)
197 m_CellInfo
[row
] = NULL
;
200 m_CellInfo
[row
] = (cellStruct
*) malloc(sizeof(cellStruct
) * m_NumCols
);
201 for (int col
= 0; col
< m_NumCols
; col
++)
202 m_CellInfo
[row
][col
].flag
= cellFree
;
209 void wxHtmlTableCell::AddRow(const wxHtmlTag
& tag
)
212 // VS: real allocation of row entry is done in AddCell in order
213 // to correctly handle empty rows (i.e. "<tr></tr>")
214 // m_ActualCol == -1 indicates that AddCell has to allocate new row.
218 if (tag
.HasParam(wxT("BGCOLOR")))
219 tag
.GetParamAsColour(wxT("BGCOLOR"), &m_rBkg
);
220 if (tag
.HasParam(wxT("VALIGN")))
221 m_rValign
= tag
.GetParam(wxT("VALIGN"));
223 m_rValign
= m_tValign
;
228 void wxHtmlTableCell::AddCell(wxHtmlContainerCell
*cell
, const wxHtmlTag
& tag
)
230 // Is this cell in new row?
231 // VS: we can't do it in AddRow, see my comment there
232 if (m_ActualCol
== -1)
234 if (m_ActualRow
+ 1 > m_NumRows
- 1)
235 ReallocRows(m_ActualRow
+ 2);
243 } while ((m_ActualCol
< m_NumCols
) &&
244 (m_CellInfo
[m_ActualRow
][m_ActualCol
].flag
!= cellFree
));
246 if (m_ActualCol
> m_NumCols
- 1)
247 ReallocCols(m_ActualCol
+ 1);
249 int r
= m_ActualRow
, c
= m_ActualCol
;
251 m_CellInfo
[r
][c
].cont
= cell
;
252 m_CellInfo
[r
][c
].colspan
= 1;
253 m_CellInfo
[r
][c
].rowspan
= 1;
254 m_CellInfo
[r
][c
].flag
= cellUsed
;
255 m_CellInfo
[r
][c
].minheight
= 0;
256 m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_TOP
;
258 /* scan for parameters: */
262 if (tag
.HasParam(wxT("WIDTH")))
264 wxString wd
= tag
.GetParam(wxT("WIDTH"));
266 if (wd
[wd
.Length()-1] == wxT('%'))
268 wxSscanf(wd
.c_str(), wxT("%i%%"), &m_ColsInfo
[c
].width
);
269 m_ColsInfo
[c
].units
= wxHTML_UNITS_PERCENT
;
273 wxSscanf(wd
.c_str(), wxT("%i"), &m_ColsInfo
[c
].width
);
274 m_ColsInfo
[c
].width
= (int)(m_PixelScale
* (double)m_ColsInfo
[c
].width
);
275 m_ColsInfo
[c
].units
= wxHTML_UNITS_PIXELS
;
283 tag
.GetParamAsInt(wxT("COLSPAN"), &m_CellInfo
[r
][c
].colspan
);
284 tag
.GetParamAsInt(wxT("ROWSPAN"), &m_CellInfo
[r
][c
].rowspan
);
286 // VS: the standard says this about col/rowspan:
287 // "This attribute specifies the number of rows spanned by the
288 // current cell. The default value of this attribute is one ("1").
289 // The value zero ("0") means that the cell spans all rows from the
290 // current row to the last row of the table." All mainstream
291 // browsers act as if 0==1, though, and so does wxHTML.
292 if (m_CellInfo
[r
][c
].colspan
< 1)
293 m_CellInfo
[r
][c
].colspan
= 1;
294 if (m_CellInfo
[r
][c
].rowspan
< 1)
295 m_CellInfo
[r
][c
].rowspan
= 1;
297 if ((m_CellInfo
[r
][c
].colspan
> 1) || (m_CellInfo
[r
][c
].rowspan
> 1))
301 if (r
+ m_CellInfo
[r
][c
].rowspan
> m_NumRows
)
302 ReallocRows(r
+ m_CellInfo
[r
][c
].rowspan
);
303 if (c
+ m_CellInfo
[r
][c
].colspan
> m_NumCols
)
304 ReallocCols(c
+ m_CellInfo
[r
][c
].colspan
);
305 for (i
= r
; i
< r
+ m_CellInfo
[r
][c
].rowspan
; i
++)
306 for (j
= c
; j
< c
+ m_CellInfo
[r
][c
].colspan
; j
++)
307 m_CellInfo
[i
][j
].flag
= cellSpan
;
308 m_CellInfo
[r
][c
].flag
= cellUsed
;
314 wxColour bk
= m_rBkg
;
315 if (tag
.HasParam(wxT("BGCOLOR")))
316 tag
.GetParamAsColour(wxT("BGCOLOR"), &bk
);
318 cell
->SetBackgroundColour(bk
);
321 cell
->SetBorder(TABLE_BORDER_CLR_2
, TABLE_BORDER_CLR_1
);
323 // vertical alignment:
326 if (tag
.HasParam(wxT("VALIGN")))
327 valign
= tag
.GetParam(wxT("VALIGN"));
331 if (valign
== wxT("TOP"))
332 m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_TOP
;
333 else if (valign
== wxT("BOTTOM"))
334 m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_BOTTOM
;
335 else m_CellInfo
[r
][c
].valign
= wxHTML_ALIGN_CENTER
;
339 if (tag
.HasParam(wxT("NOWRAP")))
340 m_CellInfo
[r
][c
].nowrap
= true;
342 m_CellInfo
[r
][c
].nowrap
= false;
344 cell
->SetIndent(m_Padding
, wxHTML_INDENT_ALL
, wxHTML_UNITS_PIXELS
);
347 void wxHtmlTableCell::ComputeMinMaxWidths()
349 if (m_NumCols
== 0 || m_ColsInfo
[0].minWidth
!= wxDefaultCoord
) return;
353 for (int c
= 0; c
< m_NumCols
; c
++)
355 for (int r
= 0; r
< m_NumRows
; r
++)
357 cellStruct
& cell
= m_CellInfo
[r
][c
];
358 if (cell
.flag
== cellUsed
)
360 cell
.cont
->Layout(2*m_Padding
+ 1);
361 int maxWidth
= cell
.cont
->GetMaxTotalWidth();
362 int width
= cell
.nowrap
?maxWidth
:cell
.cont
->GetWidth();
363 width
-= (cell
.colspan
-1) * m_Spacing
;
364 maxWidth
-= (cell
.colspan
-1) * m_Spacing
;
365 // HTML 4.0 says it is acceptable to distribute min/max
366 width
/= cell
.colspan
;
367 maxWidth
/= cell
.colspan
;
368 for (int j
= 0; j
< cell
.colspan
; j
++) {
369 if (width
> m_ColsInfo
[c
+j
].minWidth
)
370 m_ColsInfo
[c
+j
].minWidth
= width
;
371 if (maxWidth
> m_ColsInfo
[c
+j
].maxWidth
)
372 m_ColsInfo
[c
+j
].maxWidth
= maxWidth
;
376 // Calculate maximum table width, required for nested tables
377 if (m_ColsInfo
[c
].units
== wxHTML_UNITS_PIXELS
)
378 m_MaxTotalWidth
+= wxMax(m_ColsInfo
[c
].width
, m_ColsInfo
[c
].minWidth
);
379 else if ((m_ColsInfo
[c
].units
== wxHTML_UNITS_PERCENT
) && (m_ColsInfo
[c
].width
!= 0))
380 percentage
+= m_ColsInfo
[c
].width
;
382 m_MaxTotalWidth
+= m_ColsInfo
[c
].maxWidth
;
385 if (percentage
>= 100)
387 // Table would have infinite length
388 // Make it ridiculous large
389 m_MaxTotalWidth
= 0xFFFFFF;
392 m_MaxTotalWidth
= m_MaxTotalWidth
* 100 / (100 - percentage
);
394 m_MaxTotalWidth
+= (m_NumCols
+ 1) * m_Spacing
;
397 void wxHtmlTableCell::Layout(int w
)
399 ComputeMinMaxWidths();
401 wxHtmlCell::Layout(w
);
409 if (m_WidthFloatUnits
== wxHTML_UNITS_PERCENT
)
411 if (m_WidthFloat
< 0)
413 if (m_WidthFloat
< -100)
415 m_Width
= (100 + m_WidthFloat
) * w
/ 100;
419 if (m_WidthFloat
> 100)
421 m_Width
= m_WidthFloat
* w
/ 100;
426 if (m_WidthFloat
< 0) m_Width
= w
+ m_WidthFloat
;
427 else m_Width
= m_WidthFloat
;
437 /* 1. setup columns widths:
439 The algorithm tries to keep the table size less than w if possible.
442 int wpix
= m_Width
- (m_NumCols
+ 1) * m_Spacing
;
445 // 1a. setup fixed-width columns:
446 for (i
= 0; i
< m_NumCols
; i
++)
447 if (m_ColsInfo
[i
].units
== wxHTML_UNITS_PIXELS
)
449 m_ColsInfo
[i
].pixwidth
= wxMax(m_ColsInfo
[i
].width
,
450 m_ColsInfo
[i
].minWidth
);
451 wpix
-= m_ColsInfo
[i
].pixwidth
;
454 // 1b. Calculate maximum possible width if line wrapping would be disabled
455 // Recalculate total width if m_WidthFloat is zero to keep tables as small
458 for (i
= 0; i
< m_NumCols
; i
++)
459 if (m_ColsInfo
[i
].width
== 0)
461 maxWidth
+= m_ColsInfo
[i
].maxWidth
;
466 // Recalculate table width since no table width was initially given
467 int newWidth
= m_Width
- wpix
+ maxWidth
;
469 // Make sure that floating-width columns will have the right size.
470 // Calculate sum of all floating-width columns
472 for (i
= 0; i
< m_NumCols
; i
++)
473 if ((m_ColsInfo
[i
].units
== wxHTML_UNITS_PERCENT
) && (m_ColsInfo
[i
].width
!= 0))
474 percentage
+= m_ColsInfo
[i
].width
;
476 if (percentage
>= 100)
479 newWidth
= newWidth
* 100 / (100 - percentage
);
481 newWidth
= wxMin(newWidth
, w
- (m_NumCols
+ 1) * m_Spacing
);
482 wpix
-= m_Width
- newWidth
;
487 // 1c. setup floating-width columns:
489 for (i
= 0; i
< m_NumCols
; i
++)
490 if ((m_ColsInfo
[i
].units
== wxHTML_UNITS_PERCENT
) && (m_ColsInfo
[i
].width
!= 0))
492 m_ColsInfo
[i
].pixwidth
= wxMin(m_ColsInfo
[i
].width
, 100) * wpix
/ 100;
494 // Make sure to leave enough space for the other columns
496 for (j
= 0; j
< m_NumCols
; j
++)
498 if ((m_ColsInfo
[j
].units
== wxHTML_UNITS_PERCENT
&& j
> i
) ||
499 !m_ColsInfo
[j
].width
)
500 minRequired
+= m_ColsInfo
[j
].minWidth
;
502 m_ColsInfo
[i
].pixwidth
= wxMax(wxMin(wtemp
- minRequired
, m_ColsInfo
[i
].pixwidth
), m_ColsInfo
[i
].minWidth
);
504 wtemp
-= m_ColsInfo
[i
].pixwidth
;
508 // 1d. setup default columns (no width specification supplied):
509 // The algorithm assigns calculates the maximum possible width if line
510 // wrapping would be disabled and assigns column width as a fraction
511 // based upon the maximum width of a column
512 // FIXME: I'm not sure if this algorithm is conform to HTML standard,
513 // though it seems to be much better than the old one
515 for (i
= j
= 0; i
< m_NumCols
; i
++)
516 if (m_ColsInfo
[i
].width
== 0) j
++;
521 for (i
= 0; i
< m_NumCols
; i
++)
522 if (m_ColsInfo
[i
].width
== 0)
524 // Assign with, make sure not to drop below minWidth
526 m_ColsInfo
[i
].pixwidth
= (int)(wpix
* (m_ColsInfo
[i
].maxWidth
/ (float)maxWidth
) + 0.5);
528 m_ColsInfo
[i
].pixwidth
= wpix
/ j
;
530 // Make sure to leave enough space for the other columns
533 for (r
= i
+ 1; r
< m_NumCols
; r
++)
535 if (!m_ColsInfo
[r
].width
)
536 minRequired
+= m_ColsInfo
[r
].minWidth
;
538 m_ColsInfo
[i
].pixwidth
= wxMax(wxMin(wpix
- minRequired
, m_ColsInfo
[i
].pixwidth
), m_ColsInfo
[i
].minWidth
);
542 if (m_ColsInfo
[i
].pixwidth
> (wpix
* (m_ColsInfo
[i
].maxWidth
/ (float)maxWidth
) + 0.5))
544 int diff
= (int)(m_ColsInfo
[i
].pixwidth
- (wpix
* m_ColsInfo
[i
].maxWidth
/ (float)maxWidth
+ 0.5));
545 maxWidth
+= diff
- m_ColsInfo
[i
].maxWidth
;
548 maxWidth
-= m_ColsInfo
[i
].maxWidth
;
550 wpix
-= m_ColsInfo
[i
].pixwidth
;
554 /* 2. compute positions of columns: */
556 int wpos
= m_Spacing
;
557 for (int i
= 0; i
< m_NumCols
; i
++)
559 m_ColsInfo
[i
].leftpos
= wpos
;
560 wpos
+= m_ColsInfo
[i
].pixwidth
+ m_Spacing
;
564 /* 3. sub-layout all cells: */
566 int *ypos
= new int[m_NumRows
+ 1];
570 wxHtmlContainerCell
*actcell
;
573 for (actrow
= 1; actrow
<= m_NumRows
; actrow
++) ypos
[actrow
] = -1;
574 for (actrow
= 0; actrow
< m_NumRows
; actrow
++)
576 if (ypos
[actrow
] == -1) ypos
[actrow
] = ypos
[actrow
-1];
577 // 3a. sub-layout and detect max height:
579 for (actcol
= 0; actcol
< m_NumCols
; actcol
++) {
580 if (m_CellInfo
[actrow
][actcol
].flag
!= cellUsed
) continue;
581 actcell
= m_CellInfo
[actrow
][actcol
].cont
;
583 for (int i
= actcol
; i
< m_CellInfo
[actrow
][actcol
].colspan
+ actcol
; i
++)
584 fullwid
+= m_ColsInfo
[i
].pixwidth
;
585 fullwid
+= (m_CellInfo
[actrow
][actcol
].colspan
- 1) * m_Spacing
;
586 actcell
->SetMinHeight(m_CellInfo
[actrow
][actcol
].minheight
, m_CellInfo
[actrow
][actcol
].valign
);
587 actcell
->Layout(fullwid
);
589 if (ypos
[actrow
] + actcell
->GetHeight() + m_CellInfo
[actrow
][actcol
].rowspan
* m_Spacing
> ypos
[actrow
+ m_CellInfo
[actrow
][actcol
].rowspan
])
590 ypos
[actrow
+ m_CellInfo
[actrow
][actcol
].rowspan
] =
591 ypos
[actrow
] + actcell
->GetHeight() + m_CellInfo
[actrow
][actcol
].rowspan
* m_Spacing
;
595 for (actrow
= 0; actrow
< m_NumRows
; actrow
++)
597 // 3b. place cells in row & let'em all have same height:
599 for (actcol
= 0; actcol
< m_NumCols
; actcol
++)
601 if (m_CellInfo
[actrow
][actcol
].flag
!= cellUsed
) continue;
602 actcell
= m_CellInfo
[actrow
][actcol
].cont
;
603 actcell
->SetMinHeight(
604 ypos
[actrow
+ m_CellInfo
[actrow
][actcol
].rowspan
] - ypos
[actrow
] - m_Spacing
,
605 m_CellInfo
[actrow
][actcol
].valign
);
607 for (int i
= actcol
; i
< m_CellInfo
[actrow
][actcol
].colspan
+ actcol
; i
++)
608 fullwid
+= m_ColsInfo
[i
].pixwidth
;
609 fullwid
+= (m_CellInfo
[actrow
][actcol
].colspan
- 1) * m_Spacing
;
610 actcell
->Layout(fullwid
);
611 actcell
->SetPos(m_ColsInfo
[actcol
].leftpos
, ypos
[actrow
]);
614 m_Height
= ypos
[m_NumRows
];
618 /* 4. adjust table's width if it was too small: */
621 int twidth
= m_ColsInfo
[m_NumCols
-1].leftpos
+
622 m_ColsInfo
[m_NumCols
-1].pixwidth
+ m_Spacing
;
623 if (twidth
> m_Width
)
633 //-----------------------------------------------------------------------------
634 // The tables handler:
635 //-----------------------------------------------------------------------------
638 TAG_HANDLER_BEGIN(TABLE
, "TABLE,TR,TD,TH")
641 wxHtmlTableCell
* m_Table
;
642 wxString m_tAlign
, m_rAlign
;
644 TAG_HANDLER_CONSTR(TABLE
)
647 m_tAlign
= m_rAlign
= wxEmptyString
;
651 TAG_HANDLER_PROC(tag
)
653 wxHtmlContainerCell
*c
;
655 // new table started, backup upper-level table (if any) and create new:
656 if (tag
.GetName() == wxT("TABLE"))
658 wxHtmlTableCell
*oldt
= m_Table
;
659 wxHtmlContainerCell
*oldcont
;
661 oldcont
= c
= m_WParser
->OpenContainer();
663 m_Table
= new wxHtmlTableCell(c
, tag
);
667 if (tag
.HasParam(wxT("WIDTH")))
669 wxString wd
= tag
.GetParam(wxT("WIDTH"));
671 if (wd
[wd
.Length()-1] == wxT('%'))
674 wxSscanf(wd
.c_str(), wxT("%i%%"), &width
);
675 m_Table
->SetWidthFloat(width
, wxHTML_UNITS_PERCENT
);
680 wxSscanf(wd
.c_str(), wxT("%i"), &width
);
681 m_Table
->SetWidthFloat((int)(m_WParser
->GetPixelScale() * width
), wxHTML_UNITS_PIXELS
);
685 m_Table
->SetWidthFloat(0, wxHTML_UNITS_PIXELS
);
687 int oldAlign
= m_WParser
->GetAlign();
688 m_tAlign
= wxEmptyString
;
689 if (tag
.HasParam(wxT("ALIGN")))
690 m_tAlign
= tag
.GetParam(wxT("ALIGN"));
694 m_WParser
->SetAlign(oldAlign
);
695 m_WParser
->SetContainer(oldcont
);
696 m_WParser
->CloseContainer();
706 if (tag
.GetName() == wxT("TR"))
708 m_Table
->AddRow(tag
);
710 if (tag
.HasParam(wxT("ALIGN")))
711 m_rAlign
= tag
.GetParam(wxT("ALIGN"));
717 c
= m_WParser
->SetContainer(new wxHtmlContainerCell(m_Table
));
718 m_Table
->AddCell(c
, tag
);
720 m_WParser
->OpenContainer();
722 if (tag
.GetName() == wxT("TH")) /*header style*/
723 m_WParser
->SetAlign(wxHTML_ALIGN_CENTER
);
725 m_WParser
->SetAlign(wxHTML_ALIGN_LEFT
);
730 if (tag
.HasParam(wxT("ALIGN")))
731 als
= tag
.GetParam(wxT("ALIGN"));
733 if (als
== wxT("RIGHT"))
734 m_WParser
->SetAlign(wxHTML_ALIGN_RIGHT
);
735 else if (als
== wxT("LEFT"))
736 m_WParser
->SetAlign(wxHTML_ALIGN_LEFT
);
737 else if (als
== wxT("CENTER"))
738 m_WParser
->SetAlign(wxHTML_ALIGN_CENTER
);
740 m_WParser
->OpenContainer();
746 TAG_HANDLER_END(TABLE
)
752 TAGS_MODULE_BEGIN(Tables
)
754 TAGS_MODULE_ADD(TABLE
)
756 TAGS_MODULE_END(Tables
)