前言
在进行开发企业信息化建设的过程,应该有很多这样的场景,就是将现有的电子表格记录的方式转换为在数据系统中进行网页上报。也就是需要根据当前一直使用的表格制作一个上传这个表格信息的网页,如果要减少系统的使用学习成本,加上系统的数据字段没有什么变更,我们可以直接沿用表格的样式,就需要快速的根据这个表格来生成对应的网页。从而能快速的做出一个演示Demo。
生成
这里以这个施工日志表来进行一个转换演示:
这里使用了wps为编辑软件,不过office好像也可以,以excel为例子,直接另存为html文件即可:
用浏览器打开文件,效果如图:
转换后网页的代码如下(去除了style和部分注释):
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="ProgId" content="Excel.Sheet">
<meta name="Generator" content="WPS Office ET">
</head>
<body link="blue" vlink="purple">
<table width="1381.33" border="0" cellpadding="0" cellspacing="0" style='width:518.00pt;border-collapse:collapse;table-layout:fixed;'>
<col width="136" style='width:51.00pt;'/>
<col width="249.07" span="5" style='mso-width-source:userset;mso-width-alt:3985;'/>
<tr height="36" style='height:13.50pt;'>
<td height="36" width="136" style='height:13.50pt;width:51.00pt;'></td>
<td width="249.07" style='width:93.40pt;'></td>
<td width="249.07" style='width:93.40pt;'></td>
<td width="249.07" style='