John Mobbs wrote:
>
> Only a couple of questions remain. One is, how can we specify column widths
> in tables in styled view. My colleague has tried colspec and colwidth
> mentioned under table rendering in the help but with no success. Does this,
> perhaps, apply only to XHTML files? If you could let us have a fragment of
> code to do this (and whereabouts to put it in the file) it would be much
> appreciated.
In what follows, I suppose that you don't write XHTML or DocBook
documents. I suppose that you have a proprietary DTD.
We have written 2 special table renderers: one for XHTML (i.e. HTML 4)
tables and one for DocBook (i.e. CALS) tables.
These table renderers can infer the width of columns from XML
application specific attributes or elements (example: <col>, <colgroup>
for XHTML, <colspec> for DocBook) among many other things.
Anyone can write such table renderers (called StyleHooks) which are
dynamically loaded by XXE at startup time. The problem is that the API
of such table renderers is not yet documented.
Without a custom table renderer for your XML application, you must use
the "width" css property for table cells.
Example: let's suppose that in your specific XML application, the
element name for cells is "cell" and that a "cell" has a "role"
attribute which is used to classify it. Add something like this to your
CSS style sheet:
cell {
display: table-cell;
border: 1 solid black;
padding: 2;
}
cell[role="column_head"] {
width: 20ex;
text-align: right;
}
Note that in XXE, the "width" CSS property can only have absolute length
values such as 50px, 20em, 2in, etc (i.e. NOT 20%).
> The only other thing (perhaps a wish-list item for the future) would be for
> a "Refresh" feature to refresh the styled view following a change in the
> css.
Simply reload the same stylesheet. Example: your style sheet has "My
StyleSheet" as its title and is found in file "mycss.css". Use menu
"Style", choose item called "My StyleSheet": the styled view will be
refreshed after reloading the style sheet from file "mycss.css".