我有2个表和一些我想要导出到excel的变量。我在网上找到的脚本只允许导出一个表,它可以工作。
Script used to export to excel
但我想将{{month}}
,{{location}}
和{{year}}
以及entryTable
和exitTable
中的2个表格包含在Excel文档中。
这是我的HTML
<button align="right" class="btn btn-info" ng-click="exportToExcel('#entryTable')">
<span class="fa fa-file-excel-o"></span>
</button>
<h4 align="left" id="month"><b>Month:</b> {{month}} </h4>
<h4 align="right" id="location"> <b>Local:</b> {{location}} </h4>
<h4 align="left" id="Year"><b>year:</b> 2015</h4>
<div class="col-lg-6" >
<table id="entryTable" class="table table-striped">
<tr><th colspan="4">Entry</th></tr>
<tr>
<th>Day</th>
<th>read ant</th>
<th>read act</th>
<th>Total</th>
</tr>
<tr ng-repeat="result1 in Result1">
<td align="center">{{result1.Day}}</td>
<td align="center">{{result1.inicial}}</td>
<td align="center">{{result1.final}}</td>
<td align="center">{{result1.total}}</td>
</tr>
</table>
</div>
<div class="col-lg-6">
<table id="exitTable" class="table table-striped">
<tr><th colspan="4">Exit</th></tr>
<tr>
<th>Day</th>
<th>read ant</th>
<th>read act</th>
<th>Total</th>
</tr>
<tr ng-repeat="result2 in Result2">
<td align="center">{{result2.Day}}</td>
<td align="center">{{result2.inicial}}</td>
<td align="center">{{result2.final}}</td>
<td align="center">{{result2.total}}</td>
</tr>
</table>
</div>
您对此有何其他建议?