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

2019年12月10日火曜日

テーブル要素を画面の上下中央に配置したい


画面の上下中央の位置にテーブルを配置したい



CSSの設定

上下中央のスタイルは #mainDiv

左右中央のスタイルは .table_center



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




index.html
<!DOCTYPE html>
<html>

<head>
    <style>
    #mainDiv {
      display: table-cell;
      width: 100vw;
      height: 100vh;
      vertical-align: middle;
    }
    
    table, tr, td {
      border: solid 1px lightgray;
    }
    
    .table_center {
      margin: auto;
      border: solid 1px lightgray;
    }
    </style>
</head>

<body>
  <div id="mainDiv">
    <table class="table_center">
      <tbody>
        <tr>
          <td>
            <div>middle center</div>
          </td>
        </tr>
        <tr>
          <td>
            <div>middle center</div>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</body>
</html>




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 に課題が上がっていることが...