I am drafting a bunch of emails through apps script using html and am able to get a unordered list but can’t figure out how to get a second level list like the following:
- Item 1
- Item 2
How can I go about doing this? Here is my code that I have for the ordered list:
function emailBulletedList(listItemsArray){
var body = "";
body += "<ul style='font-size: 10pt'>";
for (i = 0;i<listItemsArray.length;i++){
if (Array.isArray(listItemsArray[i]) == true){
body += "<li style = ' margin-left: 40px'>" + listItemsArray[i][0] + "</li>";
} else {
body += "<li>" + listItemsArray[i] + "</li>";
}
}
body += "</ul>";
return body
}
I pass an array through where each item in the array is a list item. Although most items in the array are strings, occasionally I have an array which signifies that the first item in that array should be indented to a second level bullet point (ex. [“item 1″,”item 2”,[“item 3”, indent]] “item 3” would be a second level bullet point). The margin-left that I currently have is not working.
2