Add table borders using a PDF template

Last modified by Oana Florea on 2026/08/05 17:15

cogThis snippet adds borders for tables using a custom PDF template
Type
Category
Developed by

Oana Florea, Andreea Chirica

Rating
0 Votes
LicenseGNU Lesser General Public License 2.1

Description

The following CSS rules need to be added inside the style element of a custom PDF Template (see complete documentation for customizing the look and feel of the PDF export).

/* Tables */
#xwikicontent table {
  border: .1em solid #EEE;
  border-color: #EEE;
  border-style: solid;
  border-width: 1px;
  padding: 2px;
  margin-bottom: 1em;
  border-collapse: collapse;
}
#xwikicontent table tr {
  border: .1em solid #EEE;
}
#xwikicontent table th {
  border: 1px solid #EEE;
  padding: 4px 2px;
  background-color: #FAFAFA;
  line-height: 100%;
}
#xwikicontent table td {
  border: 1px solid #EEEEEE;
  background-color: #FFFFFF;
  padding: 2px;
  margin: 0;
}

Result

Prerequisites & Installation Instructions

  • Create a custom PDF template
  • Copy the snippet inside the style element of a custom PDF Template

Get Connected