您可以尝试在 HTML 中复制表格以及条件格式。
function drawTable() {
var ss_data = getData();
var data = ss_data[0];
var background = ss_data[1];
var fontColor = ss_data[2];
var fontStyles = ss_data[3];
var fontWeight = ss_data[4];
var fontSize = ss_data[5];
var html = "<table border='1'>";
for (var i = 0; i < data.length; i++) {
html += "<tr>"
for (var j = 0; j < data[i].length; j++) {
html += "<td style='height:20px;background:" + background[i][j] + ";color:" + fontColor[i][j] + ";font-style:" + fontStyles[i][j] + ";font-weight:" + fontWeight[i][j] + ";font-size:" + (fontSize[i][j] + 6) + "px;'>" + data[i][j] + "</td>";
}
html += "</tr>";
}
html + "</table>"
MailApp.sendEmail({
to: Session.getActiveUser().getEmail(),
subject: "Spreadsheet Range",
htmlBody: html
})
}
function getData(){
var ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Raw").getDataRange();
var background = ss.getBackgrounds();
var val = ss.getDisplayValues();
var fontColor = ss.getFontColors();
var fontStyles = ss.getFontStyles();
var fontWeight = ss.getFontWeights();
var fontSize = ss.getFontSizes();
return [val,background,fontColor,fontStyles,fontWeight,fontSize];
}