OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How do I center the entire DataTable in the pdf using JQuery pdfHtml5

  • Thread starter Thread starter A554551N
  • Start date Start date
A

A554551N

Guest
I'm loving using $('#tableId').DataTable() and the "pdfHtml5" button to generate a PDF. I just can't figure out how to center the information within the generated PDF.

A Table with only two columns shows up on the left of the .pdf, but would look much better if it were just centered.

I am pretty sure it's supposed to be done in the button, but have not quite figured out the last bit.

Current Example (not quite working):

Code:
extend:"pdfHtml5",
className: "btn",
text: "Export To PDF",
title: "PDF Title",
filename: "AFileName",
messageTop: "Test Message",

// And this is where I think I'm close...
customize: function(doc) {
    // doc ? = ?
}

Any thoughts?
<p>I'm loving using <code>$('#tableId').DataTable()</code> and the "pdfHtml5" button to generate a PDF. I just can't figure out how to center the information within the generated PDF. </p>

<p>A Table with only two columns shows up on the left of the .pdf, but would look much better if it were just centered.</p>

<p>I am pretty sure it's supposed to be done in the button, but have not quite figured out the last bit.</p>

<p>Current Example (not quite working):</p>

<pre><code>extend:"pdfHtml5",
className: "btn",
text: "Export To PDF",
title: "PDF Title",
filename: "AFileName",
messageTop: "Test Message",

// And this is where I think I'm close...
customize: function(doc) {
// doc ? = ?
}
</code></pre>

<p>Any thoughts?</p>
Continue reading...
 

Latest posts

Online statistics

Members online
0
Guests online
2
Total visitors
2
Ads by Eonads
Top