Table cell no border if empty
-
When a tag is empty, i.e., not filled out, the PDF does not create a border around the cell. This makes the generated PDF look inconsistent, as cells with and without borders alternate. I tried several approaches to solve this problem but none worked (e.g. adding a css class or <span style=”visibility:hidden;”> or ). Do you have an idea on how I could solve this issue?
Example code snippet:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Event Auftrag</title>
<style>
.pdf-cell {
border: 1px solid black;
min-height: 20px;
min-width: 100px;
}
</style>
</head>
<body>
<h2>Event-Auftrag: <u>[veranstaltungstitel]</u></h2>
<p>Auftragsnummer: <strong>Siehe E-Mail</strong></p>
<table style="border-collapse: collapse; width: 100%;" cellpadding="5">
<tr>
<td colspan="2" style="border-bottom: 1px solid black;">
<h3 style="margin-top: 10px; margin-bottom: 10px;"><u>Allgemein</u></h3>
</td>
</tr>
<tr>
<td class="pdf-cell"><strong>Name</strong></td>
<td class="pdf-cell">[your-name]</td>
</tr>
<tr>
<td class="pdf-cell"><strong>E-Mail</strong></td>
<td class="pdf-cell">[your-email]</td>
</tr>
<!-- Weitere Zeilen... -->
</table>
</body>
</html>Thanks for your help,
best regards!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.