HTML DOM columnSpan प्रॉपर्टी का उपयोग यह निर्दिष्ट करने के लिए किया जाता है कि कोई तत्व कॉलम में कैसे फैला है।
−
. के लिए वाक्य रचना निम्नलिखित हैकॉलमस्पैन प्रॉपर्टी सेट करना -
object.style.columnSpan = "1|all|initial|inherit"
उपरोक्त संपत्ति मूल्यों को इस प्रकार समझाया गया है -
| मान वें> <वें>विवरण वें> | |
|---|---|
| 1 | इससे तत्व एक कॉलम में बिल्कुल फैल जाता है और यह डिफ़ॉल्ट मान है। |
| सभी | तत्व सभी स्तंभों में फैला होना चाहिए |
| आरंभिक | इस गुण को प्रारंभिक मान पर पूर्वनिर्धारित करना। |
| इनहेरिट करें | मूल संपत्ति मान को विरासत में मिला |
आइए कॉलमस्पैन प्रॉपर्टी के लिए एक उदाहरण देखें -
उदाहरण
<!DOCTYPE html>
<html>
<head>
<style>
#DIV1{
column-count: 3;
background-color: papayawhip;
}
#P1{
background-color: lightcyan;
font-size: 1.4em;
}
</style>
<script>
function changeColumnSpan(){
document.getElementById("P1").style.columnSpan="all";
document.getElementById("Sample").innerHTML="The column span is now set to 1";
}
</script>
</head>
<body>
<div id="DIV1">
<p id="P1">This is a sample paragraph heading</p>
This is just some random text inside a div. This is going to turn gibberish soon.adkasfdlajfkfask . The text has turned normal now .
</div>
<p>Change the above div column span property by clicking the below button</p>
<button onclick="changeColumnSpan()">Change Column Span</button>
<p id="Sample"></p>
</body>
</html> आउटपुट

“कॉलम की अवधि बदलें . पर क्लिक करने पर "बटन -
