gpt4 book ai didi

jquery - 如何在数据表的csv导出选项中添加公司的自定义页眉或标题和页脚信息?

转载 作者:行者123 更新时间:2023-12-03 22:51:21 25 4
gpt4 key购买 nike

我正在使用数据表并尝试添加新功能,我可以在其中添加自定义标题信息或可以自定义页眉和页脚信息。

所以我想做的是,当有人在导出表信息的数据表选项上按 CSV 按钮时,将自定义公司信息添加到 CSV 文件中。

就像这里: https://datatables.net/extensions/buttons/examples/initialisation/export.html

我热衷于使用以下由数据表定义的选项“自定义”:https://datatables.net/reference/button/csv

如上面的链接所示,CSV 的选项之一称为自定义 - 我可以在 CSV 文件中添加自定义信息,但我不知道如何使用此自定义选项。因此,如果有人给我 jsfiddle 示例或一些提示将会非常有帮助。:)

除了我的问题之外,我做了一些研究,发现以下内容很有用,但不知道在 excel 和 csv 中可以使用什么:

dom: 'Bftripl',
buttons: [
'excelHtml5',
//'csvHtml5',
//'pdfHtml5',
{
extend: 'pdfHtml5',
customize: function (doc) {
doc.content.splice(1, 0, {
margin: [0, 0, 0, 12],
alignment: 'center',
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAuCAYAAACxkOBzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1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brt5mwIwRNk/lE22xmcZcnI9T8tCXMswD6QNM/8XYABHXZABxc4pngAAAABJRU5ErkJggg=='
});
}
},

从这里开始: how to customize export to csv,excel,pdf in jquery datatables

我也在这里问过这个问题:https://datatables.net/forums/discussion/38275/how-to-use-csv-customize-option-in-dattable-export-csv-button?new=1

但仍然不知道 csv???

最佳答案

我希望有人能想出一些办法,但什么也没发生。然而,正如我发现很多人关注的那样。

无论如何,我已经找到了 csv 的答案,但仍然没有找到 excel 的任何内容。因此将提出另一个问题,但对于 CSV 答案如下:

{
extend: 'csvHtml5',
customize: function (csv) {
return "My header here....\n\n"+ csv +"\n\nMy Footer here.....";
}
}

感谢 allan - 数据表专家,并没有争论我是否见过任何带有页眉和页脚的 csv。感谢艾伦,您可以在这里看到原始答案: https://datatables.net/forums/discussion/38275

谢谢,看看:)

关于jquery - 如何在数据表的csv导出选项中添加公司的自定义页眉或标题和页脚信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39988562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com