[英]How to change div style width for dynamically div tag in html in Javascript?
似乎您正在使用WebIX時,建議您在生成WebIX時更改其寬度。
根據數據視圖的文檔,代碼將如下所示:
webix.ui({
view:"dataview",
container:"dataA",
template: "<div class='webix_strong'>#title#</div> Year: #year#, rank: #rank#",
data:...,
datatype:"...",
xCount:3, //the number of items in a row
yCount:4, //the number of items in a column
type:{
width: 261,
height: 90
}
});
如果您使用的是靜態寬度,請嘗試將width
設置為auto
這樣看起來就像這樣:
webix.ui({
view:"dataview",
container:"dataA",
template: function (o) {
return "<div> <span>" + o.Title + "</span> </div>"
},
data:...,
datatype:"...",
xCount:3, //the number of items in a row
yCount:4, //the number of items in a column
type:{
width: 'auto',
height: 90
}
});
如果不起作用,您可以將整個代碼發布在webix.ui({
和})
嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.