ใช้คุณสมบัติ columnWidth เพื่อกำหนดความกว้างที่เหมาะสมของแต่ละคอลัมน์ เบราว์เซอร์จะสร้างคอลัมน์ให้มากที่สุดเท่าที่พื้นที่จะรองรับได้
ตัวอย่าง
<!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.
</div>
<script>
function display() {
document.getElementById("myID").style.columnWidth = "70px";
}
</script>
</body>
</html>