Using mPDF 8.0.x.
I am creating a PDF file with a table. In the rightmost column there is a text (let's call it the "start text") and then (just after the "start text" and still inside that table cell) I have added a span object that needs a different background color, text color, paddings... That span object must be part of the "start text" but with different format.
Following the documentation, I've added the CSS file I need to use:
$css = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/mystyles/mystylefile.css');
$mpdf->WriteHTML($css, \Mpdf\HTMLParserMode::HEADER_CSS);
In my css file:
.mySpan {
background-color:#fdb826;
color: white;
border-radius: 2px;
padding-left: 2px;
padding-right: 3px;
padding-top: 2px;
padding-bottom: 2px;
display: inline-block;
line-height: 100%;
}
Then, I add all the content and inside a table cell, after the "start text", I add:
<span class="mySpan">My text that should have paddings around</span>
The contents of that span only reflect the text and background colors styles, padding and border radius are not being applied (at least this means the css file has been added correctly).
Tried to apply that inline in the same span but the result has been the same:
<span class="mySpan" style="...">My text that should have paddings around</span>
When I use that same span in my web page (before sending it to PDF) it shows exactly what I want.
Is it possible to have a text in the same line than the start text with the styles applied? What am I doing wrong here?
Thank you very much in advance.