Google Web アプリでグリッドを作成しました。グリッドのサイズを (0px, 0px) にしたいと思っていましたが、(12px, 0px) になりました。なぜなら、グリッド内のすべての列の幅に理由もなく 4px が追加されているように見えるからです。
グリッドに対して行われたことは次のとおりです (一度に):
- グリッドの幅は「0px」に設定されました
- グリッドの高さは「0px」に設定されました
- グリッド内のセルの幅は個別に「0px」に設定されました
- グリッド内のセルの高さは個別に「0px」に設定されました
- グリッドの行の高さは「0px」に設定されました
- グリッド内のセルの行の高さは個別に「0px」に設定されました
- グリッドのパディングは「0px」に設定されました
- グリッド内のセルのパディングは個別に「0px」に設定されました
- 関数「.setCellSpacing(0)」がグリッドで呼び出されました。
- 関数「.setCellPadding(0)」がグリッドで呼び出されました。
*注: グリッドやその内側のセルには、境界線や余白は使用されていません。
ここに、私が話していることを確認できるコードをいくつか示します。
function doGet() {
var app = UiApp.createApplication();
var grid = app.createGrid(3,3);
//Used outlines since they don't affect the size of the object
grid.setStyleAttribute("outline-style","solid");
grid.setStyleAttribute("outline-width","1px");
grid.setStyleAttribute("outline-color","red");
grid.setCellPadding(0);
grid.setCellSpacing(0);
grid.setStyleAttribute("width","0px");
grid.setStyleAttribute("height","0px");
grid.setStyleAttribute("line-height","0px");
grid.setStyleAttribute("padding","0px");
for(var x = 0; x<3; x++){
for(var y = 0; y<3; y++){
grid.setStyleAttribute(y,x,"width","0px");
grid.setStyleAttribute(y,x,"height","0px");
grid.setStyleAttribute(y,x,"line-height","0px");
grid.setStyleAttribute(y,x,"padding","0px");
}
}
app.add(grid);
app.add(app.createLabel("^ The grid is right here. It's width is non-zero for some reason"));
return app;
}