function doGet() { // Get the sheet data var sheet = SpreadsheetApp.getActiveSheet(); var data = sheet.getDataRange().getValues(); // Create HTML structure for marksheet var html = HtmlService.createHtmlOutput('') .setTitle('Marksheet') .setWidth(800) .setHeight(600); html.append('

Marksheet

'); html.append(''); html.append('' + ' ' + ''); for (var i = 1; i < data.length; i++) { // Skip the header row var row = data[i]; var total = calculateTotal(row); var percentage = calculatePercentage(total); html.append('' + '' + ''); } html.append('
NameRoll No.Subject 1Subject 2TotalPercentage
' + row[0] + '' + row[1] + '' + row[2] + '' + row[3] + '' + total + '' + percentage + '%
'); return html; } // Helper functions for calculations function calculateTotal(row) { // Add up marks for each subject // ... } function calculatePercentage(total) { // Calculate percentage based on total marks // ... }