In the html2pdf library I make a table in a table, and when I put the border: 1px solid black; in it border: 1px solid black; it turns out such a thing here:

enter image description here

And here is the code itself:

 <table style="width: 100%;"> <tr> <td style='width: 50%;'> <p style="text-align: center;"> <img src='http://fasts-like.com/karkas/<?php echo $profilInfo[$i]['img']; ?>'> </p> </td> <td style='width: 50%;'> <table style="width: 100%;" > <tr> <td style='width: 55%;text-align: left;border: 1px solid black;'> <?php echo $profilInfo[$i]['name']; ?> А </td> <td style='width: 20%;text-align: center;border: 1px solid black;'> 15 п/м. </td> <td style='width: 25%;text-align: center;border: 1px solid black;'> 15 290 руб </td> </tr> <tr> <td style='width: 55%;text-align: left;border: 1px solid black;'> <?php echo $profilInfo[$i]['name']; ?> B </td> <td style='width: 20%;text-align: center;border: 1px solid black;'> 30 п/м. </td> <td style='width: 25%;text-align: center;border: 1px solid black;'> 40 290 руб </td> </tr> </table> </td> </tr> </table> 

And you need this:

enter image description here

1 answer 1

Perhaps the problem in border-collapse: collapse; if I understood the question correctly.

 table { border-collapse: collapse; } 
 <table style="width: 100%;"> <tr> <td style='width: 50%;'> <p style="text-align: center;"> <img src='http://fasts-like.com/karkas/<?php echo $profilInfo[$i]['img']; ?>'> </p> </td> <td style='width: 50%;'> <table style="width: 100%;" > <tr> <td style='width: 55%;text-align: left;border: 1px solid black;'> <?php echo $profilInfo[$i]['name']; ?> А </td> <td style='width: 20%;text-align: center;border: 1px solid black;'> 15 п/м. </td> <td style='width: 25%;text-align: center;border: 1px solid black;'> 15 290 руб </td> </tr> <tr> <td style='width: 55%;text-align: left;border: 1px solid black;'> <?php echo $profilInfo[$i]['name']; ?> B </td> <td style='width: 20%;text-align: center;border: 1px solid black;'> 30 п/м. </td> <td style='width: 25%;text-align: center;border: 1px solid black;'> 40 290 руб </td> </tr> </table> </td> </tr> </table> 

  • This library does not support border-collapse: collapse; - Pasha Talyanchuk
  • Well, in the styles list yourself or is it not possible? - HamSter
  • What exactly to prescribe in styles? - Pasha Talyanchuk
  • border-collapse: collapse; You insert this table somewhere, there are some styles to this page - HamSter
  • The html2pdf library does not support border-collapse: collapse; in styles - Pasha Talyanchuk