[英]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.