Custom Table in Framework - Empty Cell issue

Having trouble deploying Oxygen XML Web Author? Got a bug to report? Post it all here.
nimodka
Posts: 3
Joined: Fri Aug 04, 2023 5:23 pm

Custom Table in Framework - Empty Cell issue

Post by nimodka »

Hello Experts,
Am creating a framework where I have to do a custom table. My elements are like:
<tab>
<r><c cspan="2"><p>col1</p1></c><c><p></p1></c></r>
<r><c><p>col1</p1></c><c><p>col2</p1></c></r>
<r><c><p>col1</p1></c><c><p>col2</p1></c></r>
</tab>
You can see that second column of first row is empty. I need to suppress this cell. I am doing CSS like this:
c:has(p:empty) {
display:none;
visibility: hidden;
}
This works well in Oxygen Author Desktop. But in Web it is inserting those empty cells.
Can anyone help me how to fix this issue?
Also I would like to add the Table Actions in toolbar. Any links to the steps followed would be a great help...
thank you.
Nimod
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: Custom Table in Framework - Empty Cell issue

Post by Bogdan Dumitru »

Hello Nimod,

If you want to span the first cell over the second, empty one, try using the column-span CSS property instead of "display: none" and "visibility: hidden". Also, notice that you can you oxy_xpath Oxygen CSS Function to compute the value for the "column-span" rule.

By the way, please notice that you can add CALS table support to your framework by using the web-author-CALS-plugin. This might be useful if you don't necessarily need to create a custom table format.
Bogdan Dumitru
http://www.oxygenxml.com
nimodka
Posts: 3
Joined: Fri Aug 04, 2023 5:23 pm

Re: Custom Table in Framework - Empty Cell issue

Post by nimodka »

Thanks Bogdan for the quick answer.
Am using the below css for my cellspan.
c[cspan]{
table-column-span:attr(cspan);
}
but the empty cell create an extra column. For that am using c::has(p:empty) to suppress.
By the way, does the web-author-CALS-plugin support my XML vocabulary?
I will try your suggestion, thanks for your response.
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: Custom Table in Framework - Empty Cell issue

Post by Bogdan Dumitru »

Hi
Regarding "By the way, does the web-author-CALS-plugin support my XML vocabulary?", the web-author-CALS-plugin supports vocabularies that have CALS tables schemas. CALS tables look like this:

Code: Select all

<table>
  <tgroup cols="2" colsep="0">
    <colspec colnum="1" colname="col1" colwidth="32mm"/>
    <colspec colnum="2" colname="col2" colwidth="132mm"/>
    <tbody>
      <row rowsep="0">
        <entry>c1</entry>
        <entry>c2</entry>
      </row>
    </tbody>
  </tgroup>
</table>
Regarding "c:has(p:empty)", notice that the ":has" selector isn't supported in Web Author.
Bogdan Dumitru
http://www.oxygenxml.com
nimodka
Posts: 3
Joined: Fri Aug 04, 2023 5:23 pm

Re: Custom Table in Framework - Empty Cell issue

Post by nimodka »

thanks for the responses, I really appreciate this.

By the way, is there an example of a custom table actions implementation using Oxygen SDK? I have seen the cals-table plugin. but it is not really helpful.
Bogdan Dumitru
Site Admin
Posts: 142
Joined: Tue Mar 20, 2018 5:28 pm

Re: Custom Table in Framework - Empty Cell issue

Post by Bogdan Dumitru »

Hi,
We don't have such examples but it might help you to see the sources of the operations that the cals-table-plugin extends, see the "ro.sync.ecss.extensions.commons.table" package from here.
Bogdan Dumitru
http://www.oxygenxml.com
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: Custom Table in Framework - Empty Cell issue

Post by mihaela »

Hello,

You can also read the following sections from the documentation about configuring tables in Oxygen XML (the documentation applies also to Web Author):
1. https://www.oxygenxml.com/doc/versions/ ... ement.html
2. https://www.oxygenxml.com/doc/versions/ ... ables.html

The second example is more DITA-oriented, but there are some examples that may help you to customize your custom tables.

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply