How To Align Email Body In Google Apps Script?
I'm facing issue in aligning the data from google sheets when sending it in email body. So far, its spacing out according to the part numbers. I want 'months' and 'quantity' in a s
Solution 1:
In your case, for example, how about using table? Please think of this as just one of several answers.
Modified script:
body += "<table style=\"border-collapse: separate; border-spacing: 20px 0px;\">"
for (var m=0;m<resultArr.length;m++) {
body+= "<tr><td>For Part No "+resultArr[m][0].toString()+ "</td><td align=\"right\">Month "+resultArr[m][1].toString()+"</td><td align=\"right\">Quantity is "+resultArr[m][2].toString()+"</td></tr>";
}
body += "</table>";
- In this modified script, the table is created without the borders and with the margin between columns of 20 px.
References:
If I misunderstood your question and this was not the direction you want, I apologize.
Post a Comment for "How To Align Email Body In Google Apps Script?"