Skip to content
This repository has been archived by the owner on Jul 25, 2021. It is now read-only.

Commit

Permalink
merge examples from feature-RowColMap-rowspan-and-colspan-algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
clarketm committed Jun 2, 2017
1 parent ec7baaa commit 1931a69
Show file tree
Hide file tree
Showing 2 changed files with 167 additions and 3 deletions.
4 changes: 1 addition & 3 deletions examples/arabic-language.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ <h1>Arabic</h1>
<script>

var ArabicTable = document.getElementById('arabic-table');
TableExport(ArabicTable, {
formats: ['xlsx']
});
TableExport(ArabicTable);

</script>

Expand Down
166 changes: 166 additions & 0 deletions examples/rowspan-colspan.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Rowspan / Colspan</title>
<link href="../dist/css/tableexport.min.css" rel="stylesheet">
<link href="./examples.css" rel="stylesheet">
</head>
<body>
<noscript>
<iframe src="//www.googletagmanager.com/ns.html?id=GTM-TL44T9" height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>

<iframe src="./default.html" frameborder="0" width="100%" scrolling="no" onload="this.height=screen.height/3;"></iframe>

<main>
<h1>Rowspan / Colspan</h1>

<table id="rowspan-colspan-table-1">
<tbody>
<tr style="background: lightblue">
<td rowspan="3" colspan="3">
[0, 0-2] [1, 0-2]
</td>
<td>[0, 3]</td>
</tr>
<tr style="background: lightgoldenrodyellow">
<td>[1, 3]</td>
</tr>
<tr style="background: lightgreen">
<td>[2, 3]</td>
</tr>
<tr style="background: lightcoral">
<td>[2, 0]</td>
<td>[2, 1]</td>
<td>[2, 2]</td>
<td>[2, 3]</td>
</tr>
</tbody>
</table>
</main>

<br>

<main>
<h1>Rowspan</h1>
<table id="rowspan-colspan-table-2">
<tbody>
<tr>
<td rowspan="2">

2016-11-15

</td>
<td>会员卡</td>
<td rowspan="3">办卡</td>
<td rowspan="2">两年卡</td>
<td>李欢</td>
<td rowspan="4">12345678901</td>
<td rowspan="2">刷卡支付</td>
<td>1000</td>
</tr>
<tr>
<td>现金</td>
<td>1980</td>
<td>1980</td>
</tr>
<tr>
<td rowspan="1">2016-11-15</td>
<td rowspan="1">会员卡</td>
<td rowspan="1">两年卡</td>
<td rowspan="1">Treating myself</td>
<td rowspan="1">13858060001</td>
<td>刷卡支付</td>
</tr>
<tr>
<td rowspan="1">2016-11-15</td>
<td rowspan="1">会员卡</td>
<td rowspan="1">两年卡</td>
<td rowspan="1">Treating myself</td>
<td rowspan="1">13858060001</td>
<td>刷卡支付</td>
<td>10</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
</tr>
</tbody>
</table>
</main>

<br>

<main>
<h1>Colspan</h1>
<table id="rowspan-colspan-table-3">
<tbody>
<tr>
<td>刷卡支付</td>
<td>1000</td>
<td>1001</td>
<td>1002</td>
</tr>
<tr>
<td colspan="2">现金</td>
<td>1980</td>
<td>1981</td>
</tr>
<tr>
<td colspan="4">会员卡</td>
</tr>
</tbody>
</table>
</main>

<script type="text/javascript" src="../bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript" src="../bower_components/js-xlsx/dist/xlsx.core.min.js"></script>
<script type="text/javascript" src="../bower_components/blobjs/Blob.min.js"></script>
<script type="text/javascript" src="../bower_components/file-saverjs/FileSaver.min.js"></script>
<script type="text/javascript" src="../dist/js/tableexport.min.js"></script>
<script type="text/javascript" src="../assets/js/analytics.js"></script>
<script>

var RowColSpan1 = document.getElementById('rowspan-colspan-table-1');
new TableExport(RowColSpan1, {
formats: ['xlsx', 'xls', 'csv', 'txt']
});
// **** jQuery **************************
// $(RowColSpan1).tableExport({
// formats: ['xlsx', 'xls', 'csv', 'txt']
// });
// **************************************


var RowColSpan2 = document.getElementById('rowspan-colspan-table-2');
new TableExport(RowColSpan2, {
formats: ['xlsx', 'xls', 'csv', 'txt']
});
// **** jQuery **************************
// $(RowColSpan2).tableExport({
// formats: ['xlsx', 'xls', 'csv', 'txt']
// });
// **************************************


var RowColSpan3 = document.getElementById('rowspan-colspan-table-3');
new TableExport(RowColSpan3, {
formats: ['xlsx', 'xls', 'csv', 'txt']
});
// **** jQuery **************************
// $(RowColSpan3).tableExport({
// formats: ['xlsx', 'xls', 'csv', 'txt']
// });
// **************************************

</script>

</body>
</html>

0 comments on commit 1931a69

Please sign in to comment.