var json = [{
"name": "客户姓名",
"englishname": "client_name",
"sewup": "N",
"relate_id": "97247"
}, {
"name": "下单日期",
"englishname": "order_date",
"sewup": "N",
"relate_id": "97250"
}, {
"name": "收货地址",
"englishname": "address",
"sewup": "I",
"relate_id": "97274"
}, {
"name": "发货方式",
"englishname": "express_name",
"sewup": "N",
"relate_id": "97256"
}, {
"name": "订单编号",
"englishname": "order_number",
"sewup": "N",
"relate_id": "97259"
}, {
"name": "所属店铺",
"englishname": "shop",
"sewup": "N",
"relate_id": "97271"
}, {
"name": "印刷定制",
"englishname": "custom",
"sewup": "I",
"relate_id": "97268"
}, {
"name": "默认账户",
"englishname": "default_bank",
"sewup": "N",
"relate_id": "97262"
}, {
"name": "发票收据",
"englishname": "need_invoice",
"sewup": "N",
"relate_id": "97265"
}];
/**
*sewup为 N 表示此对象占一个单元格. 为I表示此对象独占一行
*表格列数为3
*求大神写个算法生成如下表格
*/

I revised it again, writing it more rigorously~~
I wrote a jquery plug-in directly for you. For example, name it jquery.jstable.js
// Calling method
You need to reference jquery and plug-in js first
Personally, I think you can add a marker to the data and use the marker to determine whether colspan is needed. This saves both worry and effort
It is recommended that the poster use artTemplate instead
1. No need to spell strings anymore
2. The code is clean and tidy
3. No need to check for nulls
4. Lay the foundation for future front-end and back-end separation
...
What else are you thinking about? Try it now! ! !