Page 1 of 1

selecting the table title

Posted: Mon Dec 17, 2018 2:30 pm
by mrpaultracey
Hi all
I've been scratching my head a bit about how to select the table title. Running "Other techniques", kindly provided in the debugging CCS section, to highlight the names I get the following:

caption[ class= ''] Table 1. span[ class= '- topic/title title'] This is a Test Table

My guess it starts like the following, but having tried many variations, I cant seem to select it:

*[class ~= "topic/table"] >

Would be wonderful if you could tell me from this example, thanks a lot!

Re: selecting the table title

Posted: Tue Dec 18, 2018 1:40 pm
by Costin
Hi mrpaultracey,

First, I want to make you aware that the classes in the WebHelp output are not the same with the ones defined in the DITA source files.
You should use the CSS inspector of your internet browser to inspect styles for a specific element and find its specific selector.
For example, you can notice that, the title of a table is a "span" element, which has a "title" class and is a child of an element that has the "table" class.
Given this, to match only the title of a table, you could use a selector like:

Code: Select all

*[class~="table"] span[class~="title"]
The same way you could select the entire table caption, that contains both the table title and the label in front of a table title.
For this, you could use another selector (the CSS inspector helps in identifying this as well):

Code: Select all

*[class~="table"] > caption

Re: selecting the table title

Posted: Wed Dec 19, 2018 1:08 pm
by mrpaultracey
thanks a lot, makes sense!