The HTML DOM Style columnRuleStyle property is used to define or return the style of column rule.
Following is the syntax for −
Setting the columnRuleStyle property −
object.style.columnRuleStyle = "none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset| initial|inherit"
The above property values are explained as follows −
| Value | Description |
|---|---|
| none | This is the default value specifying no rule. |
| hidden | This is same as "none" but will still take rule space. It is basically transparent but still there. |
| dotted | This defines a dotted rule. |
| dashed | This defines a dashed rule. |
| solid | This defines a solid rule. |
| double | This defines a double rule. |
| groove | This defines a 3d groove rule and is the opposite of ridge. |
| ridge | This defines a 3D ridged rule and is the opposite of groove |
| insert | This defines a 3D rule border and the effect looks like it is embedded. It produces the opposite effect of outset. |
Let us look at an example for the columnRuleStyle property −
Example
<!DOCTYPE html>
<html>
<head>
<style>
#DIV1{
padding: 5px;
column-count: 5;
column-rule-width: 9px;
column-rule-color: lightblue;
column-rule-style: solid;
}
</style>
<script>
function changeColumnRuleStyle(){
document.getElementById("DIV1").style.columnRuleStyle="dashed";
document.getElementById("Sample").innerHTML="The column rule style is now changed.";
}
</script>
</head>
<body>
<div id="DIV1">
<img src="https://www.tutorialspoint.com/images/Swift.png"><br/>
<img src="https://www.tutorialspoint.com/images/xamarian.png"><br/>
<img src="https://www.tutorialspoint.com/images/pl-sql.png"><br/>
<img src="https://www.tutorialspoint.com/images/asp-net.png"><br/>
<img src="https://www.tutorialspoint.com/images/powerbi.png"><br/>
<img src="https://www.tutorialspoint.com/images/Tableau.png"><br/>
<img src="https://www.tutorialspoint.com/images/Big-Data-Analytics.png"><br/>
<img src="https://www.tutorialspoint.com/images/microsoftproject.png">
<img src="https://www.tutorialspoint.com/images/QlikView.png"><br/>
<img src="https://www.tutorialspoint.com/images/hadoop.png">
</div>
<p>Change the above div column style by clicking the below button</p>
<button onclick="changeColumnRuleStyle()">Change Column Rule Style</button>
<p id="Sample"></p>
</body>
</html>Output

On clicking the “Change Column Rule Style” button −
