简体   繁体   English

单个 excel 中的两个数据表下载

[英]two datatable download in single excel

I have two datatable with different fields and I want to download in both table as single excel.我有两个具有不同字段的数据表,我想在两个表中下载为单个 excel。 I tried with same class name for both table.now downloading only one table.I want to display the first table above and second table below in a excel.我尝试为两个表使用相同的 class 名称。现在只下载一个表。我想在 excel 中显示上面的第一个表和下面的第二个表。 I have two tables with class name example.我有两个带有 class 名称示例的表。 Fiddle https://jsfiddle.net/dg0cbhrL/1/小提琴https://jsfiddle.net/dg0cbhrL/1/

$('.example').dataTable();

I don't believe you can, with that setup.我不相信你可以,用那个设置。 DataTables is giving you two files, as you asked for each table to have its data exported. DataTables 为您提供了两个文件,因为您要求每个表都导出其数据。 The third is your one.第三个是你的。 The only option would be to create your own file from the data within the table (you can get this with rows().data(), and not use the DataTables Buttons exporting.唯一的选择是从表中的数据创建您自己的文件(您可以使用 rows().data() 获取此文件,而不是使用 DataTables 按钮导出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM