Mpdf: several lines in text-rotate th

Created on 26 Dec 2017  路  5Comments  路  Source: mpdf/mpdf

I found this bug

This is mPDF and PHP version and environment (fpm/cli etc) I am using

5.7.4 php-fpm

This is a PHP code snippet I use

<?php
$mpdf = new mPDF('utf-8', $this->format, 11, 'Times New Roman', 15, 15, 15, 15, 5, 5, $this->orientation);
$mpdf->WriteHTML($this->html);
$mpdf->Output($this->filename, 'F');

This is a HTML/CSS code snippet I use

<table border="1">
<tr>
<th style="text-rotate: 90"><p>Line1</p><p>Line2</p></th>
<th style="text-rotate: 90">Line1<br/>Line2</th>
</tr>
</table>

i get one line in th anytimes, but need two

image

bufix

Most helpful comment

Work Around: Use nested table
For Example:

<table border="1">
  <tr>
     <th text-rotate="90">Single Line Text</th>
     <th>
          <table>
                 <tr text-rotate="90">
                      <th>Line1</th>
                      <th>Line2</th>
                 </tr>
          </table>
     </th>
  </tr>
</table>

Use: php _wordwrap_ function to split the long text into multiple strings.

All 5 comments

has this bug been fixed?

is this issue closed?

No, bug is alive

Work Around: Use nested table
For Example:

<table border="1">
  <tr>
     <th text-rotate="90">Single Line Text</th>
     <th>
          <table>
                 <tr text-rotate="90">
                      <th>Line1</th>
                      <th>Line2</th>
                 </tr>
          </table>
     </th>
  </tr>
</table>

Use: php _wordwrap_ function to split the long text into multiple strings.

Chiranjeevi819 Big big big Thank you. This answer helped me.!!!!!!!!!!

Was this page helpful?
0 / 5 - 0 ratings