Styling definition lists like a table

Post here questions and problems related to editing and publishing DITA content.
Tomh94
Posts: 6
Joined: Mon Dec 18, 2023 6:46 pm

Styling definition lists like a table

Post by Tomh94 »

Hello,

As the title states, I would like to style <dl>'s like a table. I have found an old post (dita-editing-and-publishing-dita-conten ... 13630.html) with a solution, but that no longer seems to work.

I am unable to target the <dlentry> elements. And copy-pasting the snippet from the old post causes a failed transformation.

Engine name: DITA-OT
Severity: error
Description: [CH] Unexpected display value 'table-cell' for element 'dt'. The parent 'dl' should have display 'table-row'. The parent structure: <dl xmlns:chfox="http://www.oxygenxml.com/chemistry/extensions/fop"
URL: https://www.oxygenxml.com/DITA-messages.html#msgs__CH

The error states that the parent of the <dt> element is a <dl>, when it is in fact a <dlentry> right? So I am confused.

Any ideas?

Thanks in advance for your time!
julien_lacour
Posts: 498
Joined: Wed Oct 16, 2019 3:47 pm

Re: Styling definition lists like a table

Post by julien_lacour »

Hello,

You can follow the How to Convert Definition Lists into Tables topic from our user guide to realize this customization, it explains step by step how to create the publishing template and the XSLT stylesheet that transforms <dl> into tables.

Regards,
Julien
Post Reply