HTML DOM Style columnRuleStyle Property


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 −

ValueDescription
noneThis is the default value specifying no rule.
hiddenThis is same as "none" but will still take rule space. It is basically transparent but still there.
dottedThis defines a dotted rule.
dashedThis defines a dashed rule.
solidThis defines a solid rule.
doubleThis defines a double rule.
grooveThis defines a 3d groove rule and is the opposite of ridge.
ridgeThis defines a 3D ridged rule and is the opposite of groove
insertThis 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

 Live Demo

<!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 −

Updated on: 23-Oct-2019

25 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements