LANG SELRCT

Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

Sunday, March 10, 2019

テキストエリアの表示行数を指定したい(rows=行数)


3行まで表示してみる



textareaに直接書く場合
<textarea rows="3">

JavaScriptでやる場合
ta.setAttribute('rows', 3);



コード.gs
function doGet() {
  return HtmlService.createHtmlOutputFromFile("index");
}
意訳
この機能がやること
指定したHTMLファイルを表示する



JavaScriptでやる例でやってみる

index.html
<!DOCTYPE html>
<html>
<body>
  <textarea id="ta">
blue
red
white
yelow
green
black
</textarea>
<script>
  var ta = document.getElementById("ta");
  ta.setAttribute('rows', 3);
</script>
</body>
</html>


Latest post

Creating a template copier app in Google Apps Script

Introduction This article will show you a template copier application in Google Apps Script.  This application will automatically copy a t...