열 규칙 속성은 JavaScript에서 열 규칙을 설정하는 데 사용됩니다. 열 규칙 사이의 스타일, 색상 및 너비를 설정할 수 있습니다.
예시
다음 코드를 실행하여 JavaScript로 열 규칙 속성을 설정할 수 있습니다.
<!DOCTYPE html> <html> <body> <p>Click below to create 4 columns</p> <button onclick="display()">Columns</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.columnCount = "4"; document.getElementById("myID").style.columnRule = "2px outset red"; } </script> </body> </html>