我正在使用 json 数据创建 html 表,并且我的转换为每条记录提供了一个单独的表。
var data=[{"name":"aa","mid":"12345","user":"a123","password":"a@123"},{"name":"bb","mid":"2345","user":"b123","password":"b@123"}]
var transform=[
{"<>":"style","html":"table,th,td {border: 1px solid black;border-collapse: collapse;}th {text-align: left;}"},
{"<>":"p","html":"Dear client"},
{"<>":"p","html":"Please find below merchant users passwords are expired. Kindly take necessaray action immediately."},
{"<>":"table","style":"width:100%","html":[
{"<>":"tbody","html":[
{"<>":"tr","html":[
{"<>":"th","id":"name","html":"Client Name"},
{"<>":"th","id":"mid","html":"MID Number"},
{"<>":"th","id":"username","html":"Username"},
{"<>":"th","id":"password","html":"Current Password"}
]},
{"<>":"tbody","id":"json-body","html":[
{"<>":"tr","html":[
{"<>":"td","html":"${name}"},
{"<>":"td","html":"${mid}"},
{"<>":"td","html":"${user}"},
{"<>":"td","html":"${password}"}
]},
]},
]},
]},
{"<>":"p","html":"Thanks & Regards"},
{"<>":"p","html":"support@aa.com"}
]
如何通过将所有数据放入一个 html 表中来做到这一点?