I gave class to div as col-sm-10. But on click, I want that class to be col-sm-12 of that div. I mean, I want it to be responsive
function openNav() {
  document.getElementById("mySidenav").style.width = "15%";
}
function closeNav() {
  document.getElementById("mySidenav").style.width = "0";
}.sidenav {
  height: 100%;
  width: 0%;
  position: fixed;
  background-color: #4682B4;
  overflow-x: hidden;
  transition: 0.5s;
}
.table {
  border: 1;
  width: 100%;
  height: 100%;
  margin-top: 7%;
}<div class="row">
  <div class="col-sm-2">
    <div id="mySidenav" class="sidenav">
      <a href="javascript:void(0)" class="closebtn" onclick="closeNav()"><i class="fa fa-times-circle" style="font-size:16px;color:white"></i></a>
      <div class="menus">
        <a href="#">About</a>
        <a href="#">Services</a>
        <a href="#">Clients</a>
        <a href="#">Contact</a>
      </div>
    </div>
    <span style="font-size:30px;cursor:pointer" onclick="openNav()">☰</span>
  </div>
  <div class="col-sm-10">
    <table class="table">
      <tr>
        <th>Sr No.</th>
        <th>Title</th>
        <th>Name</th>
        <th>Picture</th>
        <th>Action</th>
        <th>Picture</th>
        <th>Action</th>
        <th>Picture</th>
        <th>Action</th>
        <th>Picture</th>
        <th>Action</th>
      </tr>
    </table>
  </div>
</div>on page load div col-sm-10 would be col-sm-12 and in openNav() function I want it to be again col-sm-10 and viceversa
can anybody help me out with the same?
 
     
     
    