ultraMatt386
ultraMatt386

Reputation: 11

Can I format the text within a HtmlService and HtmlOutput dialog box?

I have a htmlOuput dialog box that pops up during a lengthy API script is running (see script below). My question is whether I can format the dialog box and the text within it? Currently its a basic white box and all text is Times New Roman.

   var htmlOutput = HtmlService
    .createHtmlOutput('<p>Please wait whilst we process your request, this may take several minutes. Please do not refresh your page during this time. Thank you...</p>')
    .setWidth(550)
    .setHeight(300);

SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Running Request');
  var res = apiCall(sheet.getRange(cell).offset(0,1).getA1Notation(),msisdn,msisdnd_list,sheet);
 var output = HtmlService.createHtmlOutput('<script>google.script.host.close();</script>');
  SpreadsheetApp.getUi().showModalDialog(output, 'Your request is complete!');

I appreciate your help!

Upvotes: 1

Views: 314

Answers (1)

Yuri Khristich
Yuri Khristich

Reputation: 14502

I can be wrong, but it seems the styling is quite limited. For now it can be done this 'classic html' way:

var html = `
  <p style="font-family: sans-serif; color:gray; text-align:center">
  Please wait whilst we process your request, 
  this may take several minutes. 
  Please do not refresh your page during this time. Thank you...</p>
  `
var htmlOutput = HtmlService
  .createHtmlOutput(html)
  .setWidth(350)
  .setHeight(300);
  
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Running Request');

Upvotes: 2

Related Questions