danfickle / danfickle/openhtmltopdf
Padding/ Margin values with relative units not working
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 423
- PR merge metrics
- No merged PRs in 30d
Description
Hi Dan,
If padding/ margin values are provided in percentage(%) value, then no padding/ margin is getting applied. The actual HTML gives the appropriate padding/ margin. Is there any alternative/ fix for this?
```
@page
{
size:8.5in 11in portrait;
margin-left: 10px;
margin-right:15px;
margin-top:10px;
margin-bottom: 0;
}
body
{
height: 11in;
width: 8.5in;
display: block;
page-break-after: always;
margin-top: 0px;
position: relative;
}
.parent
{
display: table;
padding : 10%;
width: 99.95%;
}
.tableHead
{
display: table-row;
border: 1px solid black;
}
.tableHead span
{
display: table-cell;
width: 1px;
white-space: nowrap;
word-break: break-word;
text-align: center;
border-bottom: 1px solid black;
border-right: 1px solid black;
}
CODE
DESCRIPTION
QTY
PRICE CS
PRICE IP
PRICE PC
AMOUNT DUE
```
Here I have provided 10% padding to the .parent div, it is not getting applied. Please help!!
Below is the output when I provide padding in percentage.

Below is the output when I provide padding in pixels(NOTE: When I use absolute CSS units, it works fine. But I don't want to use absolute units, instead I want to use relative units)

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.