网页上预览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>
相关推荐
七月初七773 小时前
Excel多级联动下拉菜单设置
python·excel·pandas
inxunoffice3 小时前
批量给 Excel 表格添加文字和图片水印
excel
青涩小鱼3 小时前
Excel中国式排名,3种方法!
excel
inxunoffice18 小时前
批量删除或修改 Excel 表格的背景图片
excel
亦良Cool1 天前
将Exce中工作簿的多个工作表拆分为单独的Excel文件
前端·html·excel
woniu_maggie1 天前
SAP DOI EXCEL&宏的使用
后端·excel
saynaihe1 天前
EXCEL IF自动填充功能
microsoft·excel
cheese-liang1 天前
Excel中使用VBA自动生成排班表
android·excel
fengyehongWorld1 天前
Excel 粘贴数据到可见单元格
excel
inxunoffice1 天前
批量删除 Excel 中所有图片、某张指定图片以及二维码图片
excel