Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

80
Views
how to create a scrolling div between side bar and the table container

I want to create a scroll bar between the sidebar and the table both are in different container I tried to implement it but only the table container is displaying with the scroll and sidebar is hidden.

In side bar there would around six rows and table container which have around around 24 columns.

html,
body {
  height: 100%;
}

header,
footer {
  background: #ccc;
  height: 20%;
}

#main {
  height: 60%;
  overflow-y: scroll;
}
  
 .container{
  position:relative;
  }
 
.sidebar{

   width:30%;
   background-color:lightblue;
   height: 1000px;;
   float:left;
   margin-left: -625px;
   flex: 50%;
   }
<body>
  <div class="container" id="main">
    <div class="sidebar">
      <div class="row">
        <div class="row" id="row_id">
          "side bar content"
        </div>
      </div> 
      </div>
     </div>

  


    <div class='container-l'>
      <div id='container-table'>
        <table class="table"> 
          <thead>
              <tr>
                <th>Region</th>
                <th> Area </th>
                <th> Country </th>
             </tr>
            </thead>
 
          <tbody>
            <tr>
              <td>US</td>
              <td>North America </td>
              <td>US</td>
             </tr>  
             <tr>
              <td>US</td>
              <td>North America </td>
              <td>US</td>
            </tr>
          </tbody>
         </table>
      </div>
     </div>

 </body>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I'm not sure if I did understand the question, but you can try using columns too, or wrap the containers in a display flex div

.wrapper{
  display: flex;
}
<body>
<div class="wrapper">

<!-- your code here -->
  <div class="container" id="main">
    <div class="sidebar">
      <div class="row">
        <div class="row" id="row_id">
          "side bar content"
        </div>
      </div> 
      </div>
     </div>
     
    <div class='container-l'>
      <div id='container-table'>
        <table class="table"> 
          <thead>
              <tr>
                <th>Region</th>
                <th> Area </th>
                <th> Country </th>
             </tr>
            </thead>
 
          <tbody>
            <tr>
              <td>US</td>
              <td>North America </td>
              <td>US</td>
             </tr>  
             <tr>
              <td>US</td>
              <td>North America </td>
              <td>US</td>
            </tr>
          </tbody>
         </table>
      </div>
     </div>
     
</div>
 </body>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!