我想从表格(HTML)渲染多行。将一行渲染为一个图像(在附加图像中提到像image1,image2 ......这样的标签)。表在运行时生成。
我尝试过以下代码,但没有效果。
html2canvas($('.row.indicator-table-header'), { // render table header image
onrendered: function(canvas) {
indicatorTable=canvas.toDataURL("image/png");
var indi=0;
indicatorTableBodyImage();
console.log('Start0 : '+indi);
function indicatorTableBodyImage() {
indi++;
console.log('Start1 : '+indi);
if(indi == indicatorTableBodyLength) {
console.log('Start3 : '+indi);
form_submit('test_image_report', {
indicatorTableBodyArray : indicatorTableBodyArray
},
'post');
}
console.log('Start4 : '+indi);
html2canvas($('.row.indicator-table-body'), { // render table body image
onrendered: function(canvas) {
console.log('Start5 : '+indi);
indicator_table_body=canvas.toDataURL("image/png");
indicatorTableBodyArray[indi] = indicator_table_body;
indicatorTableBodyImage();
console.log('Start6 : '+indi);
}});
console.log('Start7End : '+indi);
} // close of for loop
}});