Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/369.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 导出为PDF格式的表显示了混乱的数据_Javascript_Php_Jquery_Pdf - Fatal编程技术网

Javascript 导出为PDF格式的表显示了混乱的数据

Javascript 导出为PDF格式的表显示了混乱的数据,javascript,php,jquery,pdf,Javascript,Php,Jquery,Pdf,我使用这个插件将jquery和php填充的表中的行导出到PDF: 表结构: <table class="table table-bordered table-striped" id="export"> <colgroup> <col width="40" /> <col width="*" /> <col width="*" /> <col width="*" /> <co

我使用这个插件将jquery和php填充的表中的行导出到PDF:

表结构:

<table class="table table-bordered table-striped" id="export">
   <colgroup>
    <col width="40" />
    <col width="*" />
    <col width="*" />
    <col width="*" />
    <col width="*" />
  </colgroup>
  <thead>
    <tr style="cursor:default;">
        <th align="center" style="text-align:center;">No</th>
        <th align="left" style="text-align:left;">Nama Usahawan</th>
        <th align="left" style="text-align:left;">Nama Peniagaan</th>
        <th align="left" style="text-align:left;">SSM No</th>
        <th align="left" style="text-align:left;">Kluster Perniagaan</th>
        <th align="left" style="text-align:left;">Created Date</th>
        <th align="left" style="text-align:left;">District</th>
    </tr>
  </thead>
  <tbody id="TBodyList">
    <tr>
        <td colspan="5" align="left" style="text-align:left;">&nbsp;</td>
   </tr>
  </tbody>
</table>
以下是表格的显示方式:


摆脱colgroup,看看它是否看起来像better@dandavis,删除colgroup不会进行任何更改
<a href="#" target="_blank" onClick ="$('#export').tableExport({type:'pdf',escape:'false'});">[EXPORT TO PDF]</a> - refer to detail report!
<script type="text/javascript" src="<?php echo $BaseUrl; ?>js/tableExport.js"></script>
<script type="text/javascript" src="<?php echo $BaseUrl; ?>js/jquery.base64.js"></script>
<script type="text/javascript" src="<?php echo $BaseUrl; ?>js/jspdf/libs/sprintf.js"></script>
<script type="text/javascript" src="<?php echo $BaseUrl; ?>js/jspdf/jspdf.js"></script>
<script type="text/javascript" src="<?php echo $BaseUrl; ?>js/jspdf/libs/base64.js"></script>
  $.fn.extend({
        tableExport: function(options) {
        var defaults = {
        separator: ',',
        ignoreColumn: [],
        tableName:'export',
        type:'pdf',
        pdfFontSize:8,
        pdfLeftMargin:5,
        escape:'true',
        htmlContent:'false',
        consoleLog:'false'
    };
 });