Author mode: table columns (Table Cell Span Provider?)

Having trouble installing Oxygen? Got a bug to report? Post it all here.
kduncklee
Posts: 1
Joined: Tue Oct 07, 2008 1:20 am

Author mode: table columns (Table Cell Span Provider?)

Post by kduncklee »

I would like to organize a set of tags in a table in the author view. I am able to do so by following the simple tutorial (http://www.oxygenxml.com/doc/ug-oxygen/ ... e-css.html). The problem is that one of the tags is optional. This causes the columns to not line up.

Example:

Code: Select all


<fields>
<field>
<name>a</name>
<optional>o</optional>
<value>1</value>
</field>
<field>
<name>b</name>
<value>2</value>
</field>
</fields>
Will produce:

Code: Select all


a o 1
b 2
Is there a way I can get it to produce this?

Code: Select all


a o 1
b 2
Do I need to create a Table Cell Span Provider?

Thanks,
Kevin
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Author mode: table columns (Table Cell Span Provider?)

Post by alex_jitianu »

Hello,

In order to provide information about cell spanning you will have to create a Table Cell Span Provider.
In method AuthorTableCellSpanProvider.getColSpan(AuthorElement cellElement) you will have to check if the given cellElement is the optional element (you can use AuthorElement.getLocalName()). If that's the case, you must count the following rows that do not contain that optional element. This number represents the collspan for that cell.
In order to navigate through the node structure you can use the API from the AuthorElement class:
- AuthorNode getParent() to get to the row/table element
- List getContentNodes() to iterate through the children of the table/row


Best regards,
Alex
Post Reply