美文网首页Markdownmarkdown指南
让Markdown支持复杂表格

让Markdown支持复杂表格

作者: 签到钱就到 | 来源:发表于2017-02-08 17:55 被阅读18910次

1.简单的表格

Markdown语言支持表格,但对表格有很多限制。
简单的表格通过下面的格式即可生成,

如下的Markdown语言:

| 项目 | 价格 | 数量 |

| -------- | -----: | :----: |

| 计算机 | $1600 | 5 |

| 手机 | $12 | 12 |

| 管线 | $1 | 234 |

能生成下面的表格:

项目 价格 数量
计算机 $1600 5
手机 $12 12
管线 $1 234

2.复杂的表格#

Markdown 语法的目标是:成为一种适用于网络的书写语言。

Markdown有个特性就是兼容 HTML

那么对于复杂的表格,比如合并了单元格,非常庞大的单元格等等,是不是可以利用一下支持Html格式的特性呢?
百度文库里随便找篇文章领导干部民主测评表

试想一下,如果用第一节的Markdown语言编辑出对应的excel,真是劳民伤财啊!给谁谁都不愿意干吧。

如果这个表格仅仅是用来阅读,展示一些信息,那么完全可以用下面的方式来显示。

  1. 准备好要处理的excel表格
  2. 打开excel,另存为html格式——wps、office都支持
  3. 找到新生成的文件夹下带sheet的html文件,并用浏览器打开预览,找到想要转换的文件。
  4. 用NotePad++等阅读工具打开html,找到<table>...</table>标签下的内容,复制到Markdown编辑器内。
  5. 表格即完成了Markdown的转换。

下面的虽然不是百分百完美解决问题,仍然有些欠缺,可能跟这个excel表格有关系。
懂Html语言的,可以在这个基础上,删除一些单元格,做一些样式的美化工作。

简书可能暂时不支持这个HTML语言的表格,但是在其他支持的工具里,可以保证是能正常显示的。

 <table width="1262" border="0" cellpadding="0" cellspacing="0" style='width:946.50pt;border-collapse:collapse;table-layout:fixed;'>
   <col width="49" style='mso-width-source:userset;mso-width-alt:1568;'/>
   <col width="103" style='mso-width-source:userset;mso-width-alt:3296;'/>
   <col width="349" style='mso-width-source:userset;mso-width-alt:11168;'/>
   <col width="57" span="4" style='mso-width-source:userset;mso-width-alt:1824;'/>
   <col width="245" style='mso-width-source:userset;mso-width-alt:7840;'/>
   <col width="72" span="4" style='width:54.00pt;'/>
   <tr height="32" style='height:24.00pt;mso-height-source:userset;mso-height-alt:480;'>
    <td class="xl65" height="32" width="974" colspan="8" style='height:24.00pt;width:730.50pt;border-right:none;border-bottom:none;' x:str>卫生系统领导干部民主测评表</td>
    <td width="72" style='width:54.00pt;'></td>
    <td width="72" style='width:54.00pt;'></td>
    <td width="72" style='width:54.00pt;'></td>
    <td width="72" style='width:54.00pt;'></td>
   </tr>
   <tr height="36" style='height:27.00pt;mso-height-source:userset;mso-height-alt:540;'>
    <td height="36" colspan="8" style='height:27.00pt;mso-ignore:colspan;' x:str>被测评人:<span style='mso-spacerun:yes;'>                                                                             </span>年<span style='mso-spacerun:yes;'>    </span>月<span style='mso-spacerun:yes;'>    </span>日</td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="28" style='height:21.00pt;mso-height-source:userset;mso-height-alt:420;'>
    <td class="xl66" height="28" style='height:21.00pt;' x:str>类别</td>
    <td class="xl66" x:str>测评内容</td>
    <td class="xl66" x:str>评价参考要点</td>
    <td class="xl66" x:str>很满意</td>
    <td class="xl66" x:str>满意</td>
    <td class="xl66" x:str>一般</td>
    <td class="xl66" x:str>不满意</td>
    <td class="xl66" x:str>原因</td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="44" style='height:33.00pt;mso-height-source:userset;mso-height-alt:660;'>
    <td class="xl67" height="145.27" rowspan="3" style='height:108.95pt;border-right:.5pt solid windowtext;border-bottom:none;' x:str>德</td>
    <td class="xl68" x:str>政治态度</td>
    <td class="xl69" x:str>贯彻执行党的路线方针政策和上级的决策部署,政治纪律严明,有较强的大局观</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="57.27" style='height:42.95pt;mso-height-source:userset;mso-height-alt:859;'>
    <td class="xl68" x:str>道德品质</td>
    <td class="xl69" x:str>作风民主,自觉接受职工和群众监督,团结同志,与单位职工关系协调,不搞“小圈子”,有较好的口碑和声誉</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="44" style='height:33.00pt;mso-height-source:userset;mso-height-alt:660;'>
    <td class="xl68" x:str>思想作风</td>
    <td class="xl69" x:str>为人正派,坚持原则,秉公办事,自觉维护单位集体利益和职工个人利益</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="61.27" style='height:45.95pt;mso-height-source:userset;mso-height-alt:919;'>
    <td class="xl67" height="264.53" rowspan="5" style='height:198.40pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>能</td>
    <td class="xl71" x:str>能力水平</td>
    <td class="xl69" x:str>具有较强的决策能力、执行能力和业务能力,责任意识强,以身作则,能起到带头示范作用,无重大工作失误</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="60" style='height:45.00pt;mso-height-source:userset;mso-height-alt:900;'>
    <td class="xl71" x:str>创新能力</td>
    <td class="xl69" x:str>具有良好的开拓创新能力,工作思路清晰,工作有一定特色,敢于和善于解决复杂矛盾和突出问题</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="44" style='height:33.00pt;mso-height-source:userset;mso-height-alt:660;'>
    <td class="xl71" x:str>组织协调</td>
    <td class="xl69" x:str>具有较强的协调能力,能较好地协调内外各种关系,形成工作合力</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="41.27" style='height:30.95pt;mso-height-source:userset;mso-height-alt:619;'>
    <td class="xl71" x:str>选人用人</td>
    <td class="xl69" x:str>严格执行《干部任用条例》,知人善用,发现人才,培养干部,选人用人公开、公平、公正</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="58" style='height:43.50pt;mso-height-source:userset;mso-height-alt:870;'>
    <td class="xl71" x:str>综合管理</td>
    <td class="xl69" x:str>有较强的事业心、责任感,内部管理规范,能有效应对各类复杂情况和复杂局面,有较强的处理突发事件能力,医患关系和谐</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="44" style='height:33.00pt;mso-height-source:userset;mso-height-alt:660;'>
    <td class="xl67" height="122" rowspan="3" style='height:91.50pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>勤</td>
    <td class="xl71" x:str>工作作风</td>
    <td class="xl69" x:str>善于听取不同意见,不断改进工作作风,求真务实,作风朴实,工作扎实</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="39" style='height:29.25pt;mso-height-source:userset;mso-height-alt:585;'>
    <td class="xl71" x:str>深入科室</td>
    <td class="xl69" x:str>经常深入科室了解情况,熟悉单位实际,并能结合实际开展各项工作</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="39" style='height:29.25pt;mso-height-source:userset;mso-height-alt:585;'>
    <td class="xl71" x:str>关心职工</td>
    <td class="xl69" x:str>关心职工的思想、工作、生活,能为职工办好事、办实事</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="45.27" style='height:33.95pt;mso-height-source:userset;mso-height-alt:679;'>
    <td class="xl67" height="301.53" rowspan="6" style='height:226.15pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>绩</td>
    <td class="xl68" x:str>岗位职责</td>
    <td class="xl69" x:str>注重领导班子建设,个人在集体中认真履行职责,发挥领导干部作用</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="45.27" style='height:33.95pt;mso-height-source:userset;mso-height-alt:679;'>
    <td class="xl68" x:str>工作成效</td>
    <td class="xl69" x:str>任职期间,工作成效显著,单位医德医风显著改善,工作效率明显提高</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="44" style='height:33.00pt;mso-height-source:userset;mso-height-alt:660;'>
    <td class="xl68" rowspan="4" style='border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>重点工作</td>
    <td class="xl69" x:str>严格实行国家基本药物制度,落实药品集中采购和零差率销售制度</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="44" style='height:33.00pt;mso-height-source:userset;mso-height-alt:660;'>
    <td class="xl69" x:str>严格按照规定开展“先住院后结算”服务模式,患者得到便利</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="64" style='height:48.00pt;mso-height-source:userset;mso-height-alt:960;'>
    <td class="xl69" x:str>重视基本公共卫生服务工作,积极组织开展十四项基本公共卫生服务项目及各项重大公共卫生服务项目</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="59" style='height:44.25pt;mso-height-source:userset;mso-height-alt:885;'>
    <td class="xl69" x:str>严格执行绩效工资制度,绩效工资实施后是否起到激励机制,医务人员收入较医改实施前是否有所提高</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="64" style='height:48.00pt;mso-height-source:userset;mso-height-alt:960;'>
    <td class="xl67" height="210.27" rowspan="4" style='height:157.70pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>廉</td>
    <td class="xl68" rowspan="4" style='border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>廉洁自律</td>
    <td class="xl69" x:str>遵守政治纪律和廉政规定,落实“八项规定”要求情况,有无收受“红包”、“回扣”等损害患者利益现象,有无收受贿赂情况</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="45.27" style='height:33.95pt;mso-height-source:userset;mso-height-alt:679;'>
    <td class="xl69" x:str>对照最新的价格收费文件规定执行医疗卫生服务和药品价格收费政策</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="38" style='height:28.50pt;mso-height-source:userset;mso-height-alt:570;'>
    <td class="xl69" x:str>落实价格收费公示制度和住院费一日清单制度,使价格收费更加合理、公平、透明</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="63" style='height:47.25pt;mso-height-source:userset;mso-height-alt:945;'>
    <td class="xl69" x:str>单位财务账目清晰,严格执行政务院务公开,重大事项审批、重大财务开支按规定进行公示,资金使用公开透明</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="21" style='height:15.75pt;mso-height-source:userset;mso-height-alt:315;'>
    <td class="xl67" height="21" colspan="3" style='height:15.75pt;border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;' x:str>总体评价</td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td class="xl68"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="89" style='height:66.75pt;mso-height-source:userset;mso-height-alt:1335;'>
    <td class="xl72" height="89" style='height:66.75pt;' x:str>今后工作中的建议</td>
    <td class="xl68" colspan="7" style='border-right:.5pt solid windowtext;border-bottom:.5pt solid windowtext;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl73" height="19" style='height:14.25pt;'></td>
    <td class="xl74" colspan="5" style='mso-ignore:colspan;' x:str>注:每一栏各选项中只能选择一项,请在相应选项内划“√”。如不满意请写明原因。</td>
    <td class="xl73"></td>
    <td class="xl73"></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl73" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl73" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <tr height="19" style='height:14.25pt;'>
    <td class="xl75" height="19" colspan="8" style='height:14.25pt;mso-ignore:colspan;'></td>
    <td colspan="4" style='mso-ignore:colspan;'></td>
   </tr>
   <![if supportMisalignedColumns]>
    <tr width="0" style='display:none;'>
     <td width="49" style='width:37;'></td>
     <td width="103" style='width:77;'></td>
     <td width="349" style='width:262;'></td>
     <td width="57" style='width:43;'></td>
     <td width="245" style='width:184;'></td>
    </tr>
   <![endif]>
  </table>

相关文章

网友评论

    本文标题:让Markdown支持复杂表格

    本文链接:https://www.haomeiwen.com/subject/hyfbittx.html