tableExport.jquery.plugin
=========================
<h3>Export HTML Table to</h3>
<ul>
<li> CSV
<li> DOC
<li> JSON
<li> PDF
<li> PNG
<li> SQL
<li> TSV
<li> TXT
<li> XLS (Excel 2000 HTML format)
<li> XLSX (Excel 2007 Office Open XML format)
<li> XML (Excel 2003 XML Spreadsheet format)
<li> XML (Raw xml)
</ul>
Installation
============
To save the generated export files on client side, include in your html code:
```html
<script type="text/javascript" src="libs/FileSaver/FileSaver.min.js"></script>
```
To export the table in XLSX (Excel 2007+ XML Format) format, you need to include additionally:
```html
<script type="text/javascript" src="libs/js-xlsx/xlsx.core.min.js"></script>
```
To export the table as a PDF file the following includes are required if using jsPDF and jsPDF-AutoTable as pdf producer:
```html
<script type="text/javascript" src="libs/jsPDF/jspdf.min.js"></script>
<script type="text/javascript" src="libs/jsPDF-AutoTable/jspdf.plugin.autotable.js"></script>
```
As an alternative pdf producer you can use pdfmake. Instead of jsPDF include then
```html
<script type="text/javascript" src="libs/pdfmake/pdfmake.min.js"></script>
<script type="text/javascript" src="libs/pdfmake/vfs_fonts.js"></script>
<!-- For output of arabic characters include mirza_fonts.js instead of vfs_fonts.js -->
<!-- For output of chinese characters include either gbsn00lp_fonts.js or ZCOOLXiaoWei_fonts.js instead of vfs_fonts.js -->
```
To export the table in PNG format, you need to include:
```html
<!-- For IE support include es6-promise before html2canvas -->
<script type="text/javascript" src="libs/es6-promise/es6-promise.auto.min.js"></script>
<script type="text/javascript" src="libs/html2canvas/html2canvas.min.js"></script>
```
Regardless of the desired format, finally include:
```html
<script type="text/javascript" src="tableExport.min.js"></script>
```
Please keep this include order.
Dependencies
============
Library | Version
--------|--------
[jQuery](https://github.com/jquery/jquery) | \>= 1.9.1
[es6-promise](https://github.com/stefanpenner/es6-promise) | \>= 4.2.4
[FileSaver](https://github.com/hhurz/tableExport.jquery.plugin/blob/master/libs/FileSaver/FileSaver.min.js) | \>= 1.2.0
[html2canvas](https://github.com/niklasvh/html2canvas) | \>= 0.5.0-beta4
[jsPDF](https://github.com/MrRio/jsPDF) | \>=1.3.4
[jsPDF-AutoTable](https://github.com/simonbengtsson/jsPDF-AutoTable) | 2.0.14 or 2.0.17
[pdfmake](https://github.com/bpampuch/pdfmake) | 0.1.65
[SheetJS](https://github.com/SheetJS/js-xlsx) | \>= 0.12.5
Examples
========
```
// CSV format
$('#tableID').tableExport({type:'csv'});
```
```
// Excel 2000 html format
$('#tableID').tableExport({type:'excel'});
```
```
// XML Spreadsheet 2003 file format with multiple worksheet support
$('table').tableExport({type:'excel',
mso: {fileFormat:'xmlss',
worksheetName: ['Table 1','Table 2', 'Table 3']}});
```
```
// PDF export using jsPDF only
$('#tableID').tableExport({type:'pdf',
jspdf: {orientation: 'p',
margins: {left:20, top:10},
autotable: false}
});
```
```
// PDF format using jsPDF and jsPDF Autotable
$('#tableID').tableExport({type:'pdf',
jspdf: {orientation: 'l',
format: 'a3',
margins: {left:10, right:10, top:20, bottom:20},
autotable: {styles: {fillColor: 'inherit',
textColor: 'inherit'},
tableWidth: 'auto'}
}
});
```
```
// PDF format with callback example
function DoCellData(cell, row, col, data) {}
function DoBeforeAutotable(table, headers, rows, AutotableSettings) {}
$('table').tableExport({fileName: sFileName,
type: 'pdf',
jspdf: {format: 'bestfit',
margins: {left:20, right:10, top:20, bottom:20},
autotable: {styles: {overflow: 'linebreak'},
tableWidth: 'wrap',
tableExport: {onBeforeAutotable: DoBeforeAutotable,
onCellData: DoCellData}}}
});
```
```
// PDF export using pdfmake
$('#tableID').tableExport({type:'pdf',
pdfmake:{enabled:true,
docDefinition:{pageOrientation:'landscape'}}
});
```
Options (Default settings)
=======
```
csvEnclosure: '"'
csvSeparator: ','
csvUseBOM: true
date: html: 'dd/mm/yyyy'
displayTableName: false (Deprecated)
escape: false (Deprecated)
exportHiddenCells: false
fileName: 'tableExport'
htmlContent: false
htmlHyperlink: 'content'
ignoreColumn: []
ignoreRow: []
jsonScope: 'all'
jspdf: orientation: 'p'
unit:'pt'
format: 'a4'
margins: left: 20
right: 10
top: 10
bottom: 10
onDocCreated: null
autotable: styles: cellPadding: 2
rowHeight: 12
fontSize: 8
fillColor: 255
textColor: 50
fontStyle: 'normal'
overflow: 'ellipsize'
halign: 'inherit'
valign: 'middle'
headerStyles: fillColor: [52, 73, 94]
textColor: 255
fontStyle: 'bold'
halign: 'inherit'
valign: 'middle'
alternateRowStyles: fillColor: 245
tableExport: doc: null
onAfterAutotable: null
onBeforeAutotable: null
onAutotableText: null
onTable: null
outputImages: true
mso: fileFormat: 'xlshtml'
onMsoNumberFormat: null
pageFormat: 'a4'
pageOrientation: 'portrait'
rtl: false
styles: []
worksheetName: ''
xslx: formatId: date: 14
numbers: 2
numbers: html: decimalMark: '.'
thousandsSeparator: ','
output: decimalMark: '.',
thousandsSeparator: ','
onAfterSaveToFile: null
onBeforeSaveToFile: null
onCellData: null
onCellHtmlData: null
onCellHtmlHyperlink: null
onIgnoreRow: null
onTableExportBegin: null
onTableExportEnd: null
outputMode: 'file'
pdfmake: enabled: false
docDefinition: pageOrientation: 'portrait'
defaultStyle: font: 'Roboto'
fonts: {}
preserve: leadingWS: false
trailingWS: false
preventInjection: true
sql: tableEnclosure: '`'
columnEnclosure: '`'
tbodySelector: 'tr'
tfootSelector: 'tr'
theadSelector: 'tr'
tableName: 'myTableName'
type: 'csv'
```
```ignoreColumn``` can be either an array of indexes (i.e. [0, 2]) or field names (i.e. ["id", "name"]).
* Indexes correspond to the position of the header elements `th` in the DOM starting at 0. (If the `th` elements are removed or added to the DOM, the indexes will be shifted so use the functionality wisely!)
* Field names should correspond to the values set on the "data-field" attribute of the header elements `th` in the DOM.
* "Nameless" columns without data-field attribute will be named by their index number (converted to a string)
To disable formatting of numbers in the exported output, which can be useful for csv and excel format, set the option ``` numbers: output ``` to ``` false ```.
Set the option ``` mso.fileFormat ``` to ``` 'x
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
校园迎新信息管理系统-毕业设计.zip (929个子文件)
file_manager_json.ashx 6KB
upload_json.ashx 3KB
UpLoad_Class.asp 15KB
file_manager_json.asp 6KB
JSON_2.0.4.asp 4KB
upload_json.asp 3KB
demo.asp 2KB
demo.aspx 2KB
components.css 582KB
summernote-bs3.css 143KB
bootstrap.min.css 120KB
style.css 111KB
style.min.css 97KB
animate.min.css 46KB
datepicker3.css 33KB
jquery-ui-1.9.2.custom.css 30KB
font-awesome.min.css 26KB
jquery-ui-1.9.2.custom.min.css 26KB
ambiance.css 25KB
style.min.css 25KB
default.css 20KB
bootstrap-table.css 19KB
sweetalert.css 18KB
simditor.css 17KB
bootstrap-table.min.css 17KB
layer.css 14KB
layer.css 14KB
jasny-bootstrap.min.css 14KB
chosen.css 12KB
layer.css 12KB
dropzone.css 11KB
layer.css 11KB
bootstrap-table-bulma.css 11KB
layer.css 11KB
layim.css 11KB
bootstrap-table-semantic.css 11KB
fullcalendar.css 11KB
bootstrap-table-foundation.css 11KB
bootstrap-table-materialize.css 11KB
bootstrap-table-bulma.min.css 10KB
summernote.css 10KB
bootstrap-table-semantic.min.css 10KB
plyr.css 10KB
bootstrap-table-foundation.min.css 10KB
bootstrap-table.css 10KB
bootstrap-table-materialize.min.css 10KB
bootstrap-table.min.css 9KB
codemirror.css 7KB
blueimp-gallery.min.css 7KB
awesome-bootstrap-checkbox.css 7KB
toastr.min.css 7KB
zTreeStyle.css 6KB
laydate.css 6KB
webuploader-demo.min.css 6KB
jquery.steps.css 6KB
footable.core.css 5KB
layer.css 5KB
layer.css 5KB
jquery.fancybox.css 5KB
dataTables.bootstrap.css 5KB
bootstrap-table.min.css 4KB
clockpicker.css 4KB
basic.css 4KB
style.css 4KB
layer.css 3KB
layer.css 3KB
bootstrap-colorpicker.min.css 3KB
laydate.css 3KB
cropper.min.css 3KB
layer.ext.css 3KB
ion.rangeSlider.css 3KB
jquery.nouislider.css 3KB
qq.css 3KB
layer.ext.css 3KB
layer.ext.css 3KB
bootstrap-markdown.min.css 3KB
jquery.gritter.css 3KB
demo.css 2KB
simple.css 2KB
ion.rangeSlider.skinFlat.css 2KB
login.min.css 1KB
custom.css 1KB
qy-style.css 1KB
bootstrap-table-reorder-rows.min.css 1KB
bootstrap-treeview.css 1KB
prettify.css 960B
bootstrap-table-reorder-rows.css 802B
fullcalendar.print.css 668B
bootstrap-table-fixed-columns.min.css 647B
bootstrap-table-page-jump-to.min.css 644B
switchery.css 610B
bootstrap-table-sticky-header.min.css 558B
webuploader.css 515B
bootstrap-table-group-by.min.css 513B
morris-0.4.3.min.css 442B
bootstrap-table-filter-control.min.css 429B
bootstrap-table-fixed-columns.css 370B
bootstrap-table-sticky-header.css 360B
bootstrap-table-page-jump-to.css 336B
index.css 264B
共 929 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
博士僧小星
- 粉丝: 1924
- 资源: 5892
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功