Exclude some tables from captions and List of Tables

dbutch
Posts: 13
Joined: Wed Aug 14, 2019 9:16 am

Exclude some tables from captions and List of Tables

Post by dbutch » Wed Aug 21, 2019 7:27 am

Hi,
Is it possible to exclude or ignore certain tables from table captions and also from the List of Tables?
This is in relation to topic20373.html,
I would like to exclude the caption for two tables in the PDF output. I have attempted to set the output class on both the table and the topic, and apply CSS rules based on that output class; however, the tables are still showing the captions and are present in the List of Tables.

Code: Select all

/* No table numbering */
 *[class~='topic/topic'][outputclass ~= "before-toc"] > *[class~="topic/table"] > * [class~="topic/title"]:before {
	 display: none !important;
 }
I used 'before-toc' as the output class in this case, as it is required to move the topic prior to the TOC.

Thanks.

Costin
Posts: 629
Joined: Mon Dec 05, 2011 6:04 pm

Re: Exclude some tables from captions and List of Tables

Post by Costin » Wed Aug 21, 2019 2:38 pm

Hello,

The selector you are trying to use is not the right one.
More specific, after you set the outputclass attribute on a table, the correct selector you should use, in order to match the caption of a table in the entire bookmap context, should be just something like:

Code: Select all

*[class~='topic/topic'][outputclass ~= "before-toc"]
Best Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

dbutch
Posts: 13
Joined: Wed Aug 14, 2019 9:16 am

Re: Exclude some tables from captions and List of Tables

Post by dbutch » Thu Aug 22, 2019 4:15 am

Hi Costin,

Thanks. I set base to 'no-caption' so I could still use auto-table on the outputclass attribute. The following removed the caption from the relevant tables but they are still showing in the List of Tables, and consequently increments all the other tables in that list as if they do exist.

Code: Select all

  *[class~='topic/table'][base ~= "no-caption"] caption::before {
	 display: none !important;
	 counter-increment: none !important
 }
image.png
image.png (6.63 KiB) Viewed 233 times

How would I exclude them from being shown and counted in the List of Tables?

Many thanks.

dbutch
Posts: 13
Joined: Wed Aug 14, 2019 9:16 am

Re: Exclude some tables from captions and List of Tables

Post by dbutch » Thu Aug 22, 2019 7:26 am

I think I may have found the answer...
Removing the title from the tables results in them not showing in the List of Tables. They now match the table numbers throughout the document, when used in conjunction with the CSS above.

If there is a better method then please advise.

Kind regards.

Costin
Posts: 629
Joined: Mon Dec 05, 2011 6:04 pm

Re: Exclude some tables from captions and List of Tables

Post by Costin » Thu Aug 22, 2019 11:08 am

Hello,

You solution seems legit.

As an alternative, you could try setting multiple values for the outputclass attribute for the tables whose caption you want to hide (like: outputclass="before-toc auto-table").
You could also reset the table number counters in your customization CSS, to override the counters set in the CSS corresponding to the specific numbering parameter you use in your transformation.
More details on the default CSS files that control various numbering options available in the User-Guide.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Post Reply