首页 > 解决方案 > Ionic v3:如何将离子网格表复制到 excel

问题描述

我正在尝试将网格数据复制到 Excel 表格中。

这是我的代码

<ion-grid>
   <ion-row *ngFor="let row of ['', '', '', '', '', '']; let i=index;">
      <ion-col col-3 *ngFor="let col of ['', '', '', '']; let j=index;" style="border:1px solid black;">
        TEST {{i}}.{{j}}
      </ion-col>
   </ion-row>
</ion-grid>

当我将表格粘贴到 excel 中时,它会打印为一行 instated 表格。

标签: ionic3

解决方案


我觉得没有别的办法

<table width="100%">
  <tr *ngFor="let row of ['', '', '', '', '', '']; let i=index;">
    <td text-center *ngFor="let col of ['', '', '', '']; let j=index;" style="border:1px solid black;">
      TEST {{i}}.{{j}}
    </td>
  </tr>
</table>

推荐阅读