网页上预览Excel文件

如何运行: 需要发布在服务器 如Tomcat

实例图片:

需要展示的文件:

复制代码
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>excel预览</title>
    <link rel="stylesheet" href="js-preview-lib/excel.css" />
    <script src="js-preview-lib/excel.umd.js"></script>
</head>
<body>
<div id="excel" style="width: 100vw; height: 100vh"></div>

<script>
    const myExcelPreviewer = jsPreviewExcel.init(document.getElementById('excel'));
    myExcelPreviewer .preview('./文件名.xlsx').then(()=>{
        console.log('预览完成');
    }).catch(e=>{
        console.log('预览失败', e);
    })
</script>
</body>
</html>
相关推荐
开开心心_Every7 小时前
进程启动瞬间暂停工具,适合调试多开
运维·服务器·gitee·pdf·开源·电脑·excel
葡萄城技术团队7 小时前
表格工具栏:像 Excel 只是起点,按需定制才是关键
excel
开开心心就好9 小时前
直接减少蓝光辐射的专业护眼工具
linux·运维·服务器·智能手机·excel·java-rabbitmq·sdkman
得闲喝茶1 天前
SQL处理数据的常用语法语句
数据库·笔记·sql·数据分析·excel
hmywillstronger1 天前
【Python】从SAP2000 XML截面库提取数据到Excel
xml·python·excel
抹茶咖啡1 天前
IT运维的365天--045 WPS突然就不能正常打开Excel文件了
excel·it运维·wps
专注VB编程开发20年1 天前
在 Python 中使用 comtypes 时,大小写通常必须保持精确
python·excel
E_ICEBLUE2 天前
如何提取 Word 文档中的表格并导出为 Excel(Python 教程)
python·word·excel
2501_930707782 天前
使用C#代码在 Excel 中创建雷达图
信息可视化·excel