단일 선언에서 열 너비와 열 개수를 설정하려면 JavaScript 열 재산.
예시
다음 코드를 실행하여 JavaScript로 열 너비와 열 개수를 설정할 수 있습니다. −
<!DOCTYPE html> <html> <head> <style> #myID { column-count: 4; column-rule: 4px solid yellow; } </style> </head> <body> <p>Click below to change the column count to 2 and minimum size</p> <button onclick="display()">Change Column count and set size</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. 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.columns = "70px 2"; } </script> </body> </html>