# PDF export with table composed with table-cell

**URL:** <https://forum.xwiki.org/t/pdf-export-with-table-composed-with-table-cell/506>\
**Category:** Help / Discuss\
**Created:** [August 30, 2017, 10:07am UTC](https://forum.xwiki.org/t/pdf-export-with-table-composed-with-table-cell/506 "2017-08-30T10:07:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pbas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/pbas/32/15_2.png) [@Pbas](https://forum.xwiki.org/u/Pbas)\
**Post date:** [August 30, 2017, 10:07am UTC](https://forum.xwiki.org/t/pdf-export-with-table-composed-with-table-cell/506/1 "2017-08-30T10:07:46Z")

</div>

Hello,

I writed an xwiki application with pages containing some tables without html code (th/td/etc.) but using div and CSS “display: table-cell” instead ie: [Using CSS "display: table-cell" for columns - Senktec](http://www.senktec.com/2014/01/using-css-display-table-cell-for-columns/)

Unfortunaly PDF export doesn’t export table correctly.  
I checked on [Apache(tm) FOP - Compliance](https://xmlgraphics.apache.org/fop/compliance.html) that table-cell is well supported. It is.

When I PDF export my page, “Final XHTML for export” containing my table-row/cell style:

```auto
<div class="Bloc" style="display: block; "><div class="TitreBloc" style="display: block; float: left; background-color: transparent; font-weight: bold; font-style: italic; color: black; ">Contexte</div>
<div class="SMQrow" style="display: table-row; "><div class="SMQcolumn1" style="display: table-cell; width: 30em; padding-bottom: 0.3em; padding-right: 1em; ">DG Mxxx * :</div><div class="SMQcolumn2 SMQcolumnNormalWidth" style="display: table-cell; padding-bottom: 0.3em; padding-right: 1em; ">DGAxxx</div></div>
<div class="SMQrow" style="display: table-row; "><div class="SMQcolumn1" style="display: table-cell; width: 30em; padding-bottom: 0.3em; padding-right: 1em; ">Contrat xxxxxx</div><div class="SMQcolumn2 SMQcolumnNormalWidth" style="display: table-cell; padding-bottom: 0.3em; padding-right: 1em; ">DGxxxx/div></div>

```

but on “Intermediary XSL-FO” all table-row/cell missing and use fo:block instead:

```auto
<fo:block role="html:div"><fo:block-container role="html:div"

```

I checked [xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/xhtml2fo.xsl at master · xwiki/xwiki-platform · GitHub](https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/xhtml2fo.xsl) but didn’t found some “table-cell” style.

To resume my question: how to display table in PDF export when on my xwiki page my table is formating with div/table-cll/row in CSS?

Ty

Pascal B

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [August 30, 2017, 10:16am UTC](https://forum.xwiki.org/t/pdf-export-with-table-composed-with-table-cell/506/2 "2017-08-30T10:16:03Z")

</div>

Could be an issue with CSS4J, how we use it, or FOP. Plenty of possible problems.

This requires an analysis and debugging the code (including debugging the code of CSS4J/FOP).

Could you show a screenshot of what you get? Also, IMO you should open a jira issue for this.

---

<div class="post-metadata">

**Author:** ![Pbas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/pbas/32/15_2.png) [@Pbas](https://forum.xwiki.org/u/Pbas)\
**Post date:** [August 30, 2017, 2:14pm UTC](https://forum.xwiki.org/t/pdf-export-with-table-composed-with-table-cell/506/3 "2017-08-30T14:14:49Z")

</div>

Ok I created an example on [http://playground.xwiki.org/xwiki/bin/view/Sandbox/TableToPDFExport/](http://playground.xwiki.org/xwiki/bin/view/Sandbox/TableToPDFExport/) to show PDF result of table with table-cell/row.

Note, on my xwiki I added CSS instruction in ./skins/flamingo/pdf.css

---

<div class="post-metadata">

**Author:** ![Pbas](https://forum.xwiki.org/user_avatar/forum.xwiki.org/pbas/32/15_2.png) [@Pbas](https://forum.xwiki.org/u/Pbas)\
**Post date:** [August 31, 2017, 8:38am UTC](https://forum.xwiki.org/t/pdf-export-with-table-composed-with-table-cell/506/4 "2017-08-31T08:38:54Z")

</div>

> [@vmassol](#):
>
> Also, IMO you should open a jira issue for this.

[https://jira.xwiki.org/browse/XWIKI-14650](https://jira.xwiki.org/browse/XWIKI-14650)
