Print to PDF Tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VinhPN
    Junior Member
    • Jan 2019
    • 26

    Print to PDF Tables

    Hi

    Whenever I generate a pdf with a table, it is missing the borders. I have attached some images as an example.
    The table-custom class just makes the table borders black.

    Is there any way of showing the table without using inline styling?


    Click image for larger version

Name:	wysiwg.jpg
Views:	708
Size:	62.7 KB
ID:	46163Click image for larger version

Name:	wysiwgcode.jpg
Views:	617
Size:	76.0 KB
ID:	46164Click image for larger version

Name:	wysiwgpdf.jpg
Views:	625
Size:	21.8 KB
ID:	46165
  • michib
    Member
    • Sep 2016
    • 65

    #2
    Originally posted by VinhPN
    Hi

    Whenever I generate a pdf with a table, it is missing the borders. I have attached some images as an example.
    The table-custom class just makes the table borders black.

    Is there any way of showing the table without using inline styling?


    Click image for larger version  Name:	wysiwg.jpg Views:	1 Size:	62.7 KB ID:	46163Click image for larger version  Name:	wysiwgcode.jpg Views:	1 Size:	76.0 KB ID:	46164Click image for larger version  Name:	wysiwgpdf.jpg Views:	1 Size:	21.8 KB ID:	46165
    Hi VinhPN,

    My personal experience with editing templates is that you can not deal with general css <style> blocks. I don't know why they're thrown away... I did not dig this problem and I'd like to know how to solve. Anyhow if you to revert to style inline single html blocks it's fine. In my personal experience this is the fastest way to make it work and get what you need out of tcpdf. See an example here:

    HTML Code:
    <table cellpadding="2">
        <tbody><tr>
          <th width="35%" align="left" style="font-size: 10px; border-bottom:1pt dotted #ddd"><span style="font-style: italic">Heading text</span></th>
    Hope this helps,
    Michele

    Comment

    Working...