如何使用JavaScript返回或设置列的宽度?
使用JavaScriptcolumnWidth属性设置列的宽度。
示例
您可以尝试运行以下代码以使用JavaScript设置列的宽度:
<!DOCTYPE html>
<html>
<body>
<p>Set the width of the columns</p>
<button onclick="display()">Change Width</button>
<div id="myID">
This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.
This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.
This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.
This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.
This is Demo Text. This is Demo Text. This is Demo Text. This is Demo Text.
</div>
<script>
function display() {
document.getElementById("myID").style.columnWidth = "70px";
}
</script>
</body>
</html>热门推荐
10 给女儿祝福语简短精辟
11 开业祝福语简短大气的
12 给医生简短新年祝福语
13 简短祝福语蛋糕简笔画
14 剪简短的新年祝福语
15 送花祝福语简短十一朵
16 年底拜年祝福语大全简短
17 祝福语对联文案简短大气
18 年底老板祝福语简短的