Multi-Column Layout Guide
Multi-Column Layout Guide
ChartHop's PDF renderer does not support flexbox or CSS Grid. All multi-column layouts must be built with HTML <table> elements. This guide provides ready-to-copy patterns for the most common layouts.
Packages: Basic | Standard | Premium Roles: Owner | Technical Owner
Before you start: remove default table borders
ChartHop's default stylesheet adds a border to every table. Add this to your Stylesheet tab to remove it globally before building your layout:
table, tr, td, th { border: none; }You can then add borders back selectively to specific classes.
Two-column layout
Use this for a document header with a logo on the left and company details on the right, or for any side-by-side content.
Stylesheet tab:
table, tr, td, th { border: none; }
.two-col { width: 100%; }
.two-col td { vertical-align: top; padding: 0; }
.col-left { width: 50%; }
.col-right { width: 50%; text-align: right; }Content tab:
<body>
<table class="two-col">
<tr>
<td class="col-left">
<img src="{{org.image}}" alt="Logo" width="120">
</td>
<td class="col-right">
<p>{{org.name}}</p>
<p>123 Main Street, New York, NY 10001</p>
</td>
</tr>
</table>
</body>Three-column layout
Use this for compensation statements that display multiple figures side by side.
Stylesheet tab:
table, tr, td, th { border: none; }
.three-col { width: 100%; }
.three-col td {
width: 33%;
vertical-align: top;
padding: 8px;
text-align: center;
}
.stat-label { font-size: 11px; color: #666666; text-transform: uppercase; }
.stat-value { font-size: 22px; font-weight: bold; color: #1a1a1a; }Content tab:
<body>
<table class="three-col">
<tr>
<td>
<div class="stat-label">Base Salary</div>
<div class="stat-value">{{baseComp.pay}}</div>
</td>
<td>
<div class="stat-label">Target Bonus</div>
<div class="stat-value">{{variableTarget.pay}}</div>
</td>
<td>
<div class="stat-label">Total Cash</div>
<div class="stat-value">{{cashComp}}</div>
</td>
</tr>
</table>
</body>Full document header with logo, name, and date
A common pattern for branded letterhead at the top of any document.
Stylesheet tab:
table, tr, td, th { border: none; }
.header-table { width: 100%; margin-bottom: 32px; }
.header-table td { vertical-align: middle; }
.header-logo { width: 150px; }
.header-meta { text-align: right; font-size: 12px; color: #666666; }
.header-divider { border-top: 2px solid #0057B8; margin: 16px 0; }Content tab:
<body>
<table class="header-table">
<tr>
<td>
<img src="{{org.image}}" alt="{{org.name}}" class="header-logo">
</td>
<td class="header-meta">
<p>{{org.name}}</p>
<p>{{startDate}}</p>
</td>
</tr>
</table>
<hr class="header-divider">
<p>Dear {{name.preferred}},</p>
<!-- rest of letter -->
</body>Compensation table with borders
Use when you want a formatted table with visible borders, such as an itemized breakdown.
Stylesheet tab:
table, tr, td, th { border: none; }
.comp-table { width: 100%; border-collapse: collapse; }
.comp-table th, .comp-table td {
border: 1px solid #dddddd;
padding: 8px 12px;
text-align: left;
}
.comp-table th { background-color: #f5f5f5; font-weight: bold; }
.comp-table tr:nth-child(even) td { background-color: #fafafa; }Content tab:
<body>
<table class="comp-table">
<thead>
<tr>
<th>Component</th>
<th>Amount</th>
<th>Interval</th>
</tr>
</thead>
<tbody>
<tr>
<td>Base Salary</td>
<td>{{baseComp.pay}}</td>
<td>{{baseComp.interval}}</td>
</tr>
<tr>
<td>Target Bonus</td>
<td>{{variableTarget.pay}}</td>
<td>Annually</td>
</tr>
</tbody>
</table>
</body>Tips for table-based layouts
- Set widths on <td> elements using percentages so columns are proportional. The total should add up to 100%.
- Use vertical-align: top on table cells when columns have different amounts of content, so they align at the top rather than the middle.
- Keep nesting to two levels (a table inside a table cell). Going three levels deep is the most common source of rendering artifacts like stray closing tags appearing as text.
- Always test with a downloaded PDF, not just the preview panel. Table rendering differences between the browser and the PDF engine are common.
- Use border-collapse: collapse when you want cell borders to merge cleanly. Without it, you'll see double borders between adjacent cells.
