Tables in Grail 0.3
Grail now supports Tables based on the HTML3 Table Model
draft. Most of the simple tables encountered on the Web are
rendered fairly well in Grail, but there are several issues that still
need to be addressed. Some will not be fixed until Tk itself supports
the necessary functionality (see the Special Interest
Group on Tk based Web Browsers). Others will be fixed in a future
release of Grail.
- Table rendering is too slow, however, approximately 90% of the
time building a table is spent simply in creating new Viewer objects
for the caption and cells. It would be much better to recycle Viewers
where possible. This may be remedied in Grail 0.4.
- Table rendering is synchronous, such that Grail is unresponsive
while the actual table layout calculations are being made.
- The fixed layout algorithm is not implemented. Fixed layout
tables (e.g. those with an explicit COLS attribute on the
TABLE tag), are rendered using the autolayout algorithm.
Adherence to the Specification
- The table parser should be more robust in the face of unbalanced
or broken HTML.
- The common attributes (ID, CLASS,
STYLE, LANG, DIR), are not honored.
- Of the standard units for widths, only screen pixels
(either denoted as a unmodified number, or with the px suffix),
and percentage widths (% suffix) are honored. All other width
specification is ignored.
The <TABLE> tag:
- COLS is ignored.
- Due to limitations in Tk, FRAME=VOID is rendered
with no border, but any other value is rendered as if
- Similarly, RULES=NONE is rendered with no internal
rules, however any other value is rendered as if
The <CAPTION> tag:
- ALIGN=TOP and ALIGN=BOTTOM are honored, but
all other values are rendered as if ALIGN=TOP.
- The <COLGROUP> tag is ignored.
- The <COL> tag is ignored.
The <TD> and <TH> tags:
- AXIS and AXES are ignored.
- NOWRAP is ignored.
- Really tall tables aren't scrolled gracefully. This is due to Tk
limitation that treats all embedded windows as a single character.
Grail can optionally employ a smooth scrolling
hack that ought help, but its interaction with tables is
currently pretty bad.
- When a table contains cells that are not initially visible, cells
can temporarily show up at the upper right corner of the canvas. This
seems to be caused by a Tk canvas bug. Fortunately, scrolling around
a little bit pops the offending cell into its rightful place within
- When the content of a cell doesn't fill all of its available
vertical space, it should be centered within the cell.
- When an applets inside a table resizes its topmost frame, the
table will not automatically recalculate its layout.