画面の上下中央の位置にテーブルを配置したい
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>
|
