関連テーブルプラグインで、テーブルを表示してみます。
概要
関連テーブルプラグインには、もともとテーブル表示の機能がありませんが、
HTMLを組み立てて表示することが出来ます。
関連テーブルプラグイン設定
対象アプリのテーブル内項目(オプションT, オプション費用T)をTAGS_HTML関数で、HTML 形式に変換して表示します。
// オプション詳細の計算式
LET(
table, TARRAY(オプションT),
IF(ARRAY_COUNT(table) = 0, "",
TAGS_HTML(
TAG("style", JOIN(ARRAY(
".custom-table { width: auto; table-layout: auto; border-collapse: collapse; }",
".custom-table th { background-color: #c0eefe; }",
".custom-table th, .custom-table td { white-space: nowrap; border: 1px solid darkgray; padding: 4px 6px; }",
".custom-table td:last-child { white-space: initial; }",
".value-right { text-align: right; }"
), NEWLINE(), 1)),
TABLE_HTML(table, OPT("pref", "custom-"),
オプションT, オプション費用T
)
)
)
)