Skip to content

Commit

Permalink
Example for rows with data-tableexport-display="none"
Browse files Browse the repository at this point in the history
  • Loading branch information
hhurz committed Oct 8, 2015
1 parent 2510596 commit e4e0ea3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ Optional html data attributes
<td style="display:none;" data-tableexport-display="always">...</td> -> hidden cell will be exported

<td data-tableexport-display="none">...</td> -> cell will not be exported

<tr data-tableexport-display="none">...</tr> -> all cells of this row will not be exported
```
34 changes: 33 additions & 1 deletion test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ <h1>
<li><a href="#" onClick="doExport('#hiddencols',
{type: 'pdf',
jspdf: {autotable: {tableWidth: 'wrap'}}});">
<img src='icons/pdf.png' alt="PDF" style="width:24px"> PDF (jsPDF-AutoTable: data-tableexport-display="none")</a></li>
<img src='icons/pdf.png' alt="PDF" style="width:24px"> PDF (jsPDF-AutoTable: cells with data-tableexport-display="none")</a></li>
<li><a href="#" onClick="doExport('#hiddenrows',
{type: 'pdf',
jspdf: {autotable: {tableWidth: 'wrap'}}});">
<img src='icons/pdf.png' alt="PDF" style="width:24px"> PDF (jsPDF-AutoTable: rows with data-tableexport-display="none")</a></li>
<li><a href="#" onClick="doExport('#invisiblecols',
{type: 'pdf',
jspdf: {autotable: {tableWidth: 'wrap'}}});">
Expand Down Expand Up @@ -237,6 +241,34 @@ <h3>Table containing unexportable cells</h3>
</tr>
</tbody>
</table>
<h3>Table containing unexportable rows</h3>
<p>Before table...</p>
<table id="hiddenrows" class="table-striped">
<thead>
<tr>
<th>C1</th>
<th>C2</th>
<th>C3</th>
</tr>
</thead>
<tbody>
<tr data-tableexport-display="none">
<td>A</td>
<td>B</td>
<td>C</td>
</tr>
<tr>
<td>D</td>
<td>E</td>
<td>F</td>
</tr>
<tr data-tableexport-display="none">
<td>G</td>
<td>H</td>
<td>I</td>
</tr>
</tbody>
</table>
<h3>Table with invisible but exportable cells</h3>
<table id="invisiblecols" class="table-striped numformat">
<thead>
Expand Down

0 comments on commit e4e0ea3

Please sign in to comment.