Datatables 插件导出是不支持excel行或列合并的。
查看源代码,导出excel 主要依赖
OOXML ,所以只需要生成对应的XML即可。
<worksheet . . .>
. . .
<cols>
<col min="1" max="1" width="26.140625" customWidth="1"/>
. . .
</cols>
<sheetData>
<row r="1">
<c r="A1" s="1" t="s">
<v>0</v>
. . .
</c>
</row>
. . .
</sheetData>
. . .
<mergeCells count="1">
<mergeCell ref="B12:J16"/>
</mergeCells>
<pageMargins . . ./>
<pageSetup . . ./>
<tableParts ccount="1">
<tableParts count="1">
</tablePart r:id="rId2"/>
</worksheet>
mergeCells 为需要合并的列或者行,ref:对应的范围