在HTML表格中,子标题应该是使用表格的< th >标签而不是< td >标签编写的。在AppScript中,使用HTML字符串构建表格时,可以在< tr >标记中包含< th >标记来创建表格子标题。
以下是示例代码:
function generateTable() {
var html ='';
html += '';
html += 'Header 1 Header 2 ';
html += 'Row 1, Cell 1 Row 1, Cell 2 ';
html += 'Row 2, Cell 1 Row 2, Cell 2 ';
html += '
';
return html;
}
这会生成一个带有表头和表格子标题的HTML表格。可以通过CSS样式来设置表格样式和外观。