Apps Script公式リファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2020年5月15日金曜日

長いテキストを折り返さず「…」で表示したい


以下のような表現をしたいときのスタイルをlabel1に書きました。




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




index.html
<!DOCTYPE html>
<html>
<head>
  <style>
    .label1 {
      border: solid 1px lightgray;
      white-space: nowrap;
      padding: 10px;
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 50vw;
    }
  </style>
</head>
<body>
  <label class="label1">あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん</label>
</body>
</html>


参考

display

overflow

white-space

text-overflow


Latest post

Google Apps Scriptの障害時はIssueTrackerを見てみる - Incidents for Apps Script are reported on Issue Tracker

IssueTracker > Apps Script issues https://issuetracker.google.com/savedsearches/566234 Google Apps Scriptの障害時は IssueTracker に課題が上がっていることが...