

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to return or set the width of the columns with JavaScript?
Use the JavaScript columnWidth property to set the width of the columns.
Example
You can try to run the following code to set the width of the columns with JavaScript:
<!DOCTYPE html> <html> <body> <p>Set the width of the columns</p> <button onclick="display()">Change Width</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. </div> <script> function display() { document.getElementById("myID").style.columnWidth = "70px"; } </script> </body> </html>
- Related Questions & Answers
- How to set the width of the rule between columns with JavaScript?
- Set the width of the rule between columns with CSS
- How to set or return the number of columns an element should be divided into with JavaScript?
- How to set the width of the bottom border with JavaScript?
- How to set the width of the top border with JavaScript?
- How to set the width of the left border with JavaScript?
- How to set the width of the right border with JavaScript?
- How to set the maximum width of an element with JavaScript?
- How to set the minimum width of an element with JavaScript?
- How to set the width of the outline around an element with JavaScript?
- How to set the gap between the columns with JavaScript?
- How to set the color of the rule between columns with JavaScript?
- How to set the style of the rule between columns with JavaScript?
- Set the width of the outline with CSS
- How to set the width of an element in JavaScript?
Advertisements