cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a custom table style for DITA-element <table>?

SOLVED
Highlighted

How to create a custom table style for DITA-element <table>?

We've got problems creating a custom table style for the DITA-element <table>. The problem is the structure DITA expects for the element <table>.

Here's an example for a table with 1 coloumn and 2 rows (1 row header, 1 row body)

<table>

     <tgroup>

          <thead>

               <row>

                    <entry></entry>

               </row>

          </thead>

          <tbody>

               <row>

                    <entry></entry>

               </row>

          </tbody>

     </tgroup>

</table>

The problems are the elements <tgroup> and <tbody> since Arbortext does neither expect an element within the <table> element that wraps the entire table, nor an element that wraps the body of the table

I can handle <tgroup> by simply defining it as the table instead of <table>. But <tbody> still makes problems.

So when I try to assign the element <row> as row to the list of user defined custom table elements, styler claims an error: context not valid. Element 'row' is not an child element of 'tgroup'

Does anyone have an idea how to handle situations like this?

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to create a custom table style for DITA-element <table>?

You should only use Custom Tables where absolutely necessary, they are quite limited. The way to control regular CALS tables is to use the table PIs to control colouring and so on. This allows you to customise the styling on a table-by-table basis. For a general style change to tables you can use stylesheet overrides to force table styling, but I think that can only be made to work with APP stylesheets.

4 REPLIES 4

Re: How to create a custom table style for DITA-element <table>?

This looks like a regular CALS table, but it sounds like you are trying to map it to a "Custom Table"? Custom Tables are for treatment of tabular-like content which displays in a grid layout. A simple example of a custom table would be something like a definition list <deflist> which has a column of "terms" and a second column of "definitions".

Re: How to create a custom table style for DITA-element <table>?

Hi Gareth and thanks for you answer.

Your right, that's exactly what we tried to do. We tried this, because in Styler "Custom Table" has some formatting options that regular tables lack, e.g. background color of cells.

If I understood you correct, mapping regular (CALS) tables to custom tables is something you neither should do nor can do with Arbortext?

Re: How to create a custom table style for DITA-element <table>?

You should only use Custom Tables where absolutely necessary, they are quite limited. The way to control regular CALS tables is to use the table PIs to control colouring and so on. This allows you to customise the styling on a table-by-table basis. For a general style change to tables you can use stylesheet overrides to force table styling, but I think that can only be made to work with APP stylesheets.

Re: How to create a custom table style for DITA-element <table>?

Thanks again, Gareth. We want to avoid the PIs wherever possible (Translaiton issues).

I will have a look at stylesheet overrides. Maybe we can do it this way. Anyway thanks again, Now I've got a better understanding of handling of tables in styler.