Forum How do I...?

Reordering content?

jean
I'd like to print figure titles below the figure in question, but in the HTML the title precedes the figure. Can prince reorder them for me in the PDF?
Lynx
Yep, you can do it using either tables or string-set property (positioning is yet another possibility, but it's less convenient).

For example if markup looks like:
<figure>
<caption>Title goes here</caption>
<content>Image goes here</content>
</figure>

You can use the following stylesheet to swap title and image:
figure
	{display:table;/*or inline-table if needs to be inline*/}
caption
	{display:table-footer-group;/* or table-caption with caption-side:bottom*/}
content
	{display:table-row}

or instead of table you can use string-set property (assuming title is just character data):
figure, content
	{display:block}
caption
	{display:none;
	string-set:title content();}
figure:after
	{content:string(title)}
jean
Wow, this looks very cool and pretty much like magic ;-)

Awesome, works perfectly with DocBook, first try:

.figure
   {display:table;}
.figure .title
   {display:table-footer-group;}
.figure .figure-contents
   {display:table-row}