<!DOCTYPE html>
<html lang="en-US">
<head>
<style>
pre{
tab-size: 4;
-moz-tab-size: 4; /*Firefox*/
-o-tab-size: 4; /*Opera 10.6-12.1*/
}
</style>
</head>
<body>
<h1>CSS tab-size Property</h1>
<pre>
This is pre tag.
</pre>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementsByTagName("pre")[0];
function myFunction(){
x.style.tabSize = "16";
x.style.MozTabSize = "16";
x.style.OTabSize = "16";
}
</script>
<p><strong>Note</strong>: Click on the button to change the 'tab-size' from 4 to 16.</p> </body>
</html>