0

I am using bootstrap 4 grid to create electron layout and success to create what I want, but I have problem when I fill each grid with data, it comes messy.

I am using this approach for create my layout : Set div height equal to screen size

The layout what I want look like this : enter image description here

This is what I get with my code : enter image description here

But if I fill more data, it comes look like this : enter image description here

enter image description here

This is my code :

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="author" content="">

        <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
        <style type="text/css">
            .full-height {
                height: 100vh;
                overflow: auto;
            }
        </style>
        <title>Test 123</title>
    </head>
    <body>
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-3 bg-light full-height">
                    <div class="row">
                        <div class="col" style="height:50vh;">
                            <h2>Section title 1</h2>
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="w-100"></div>
                        <div class="col" style="height:50vh;">
                            <h2>Section title 2</h2>
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="col-sm-4 bg-light full-height">
                    <h2>Section title3</h2>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Header</th>
                                    <th>Header</th>
                                    <th>Header</th>
                                    <th>Header</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>1,001</td>
                                    <td>Lorem</td>
                                    <td>ipsum</td>
                                    <td>dolor</td>
                                    <td>sit</td>
                                </tr>
                                <tr>
                                    <td>1,001</td>
                                    <td>Lorem</td>
                                    <td>ipsum</td>
                                    <td>dolor</td>
                                    <td>sit</td>
                                </tr>
                                <tr>
                                    <td>1,001</td>
                                    <td>Lorem</td>
                                    <td>ipsum</td>
                                    <td>dolor</td>
                                    <td>sit</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>

                <div class="col-sm-5 bg-light full-height">
                    <div class="row">
                        <div class="col" style="height:50vh;">
                            <h2>Section title 4</h2>
                            <div class="table-responsive">
                                <table class="table table-striped">
                                    <thead>
                                        <tr>
                                            <th>#</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                            <th>Header</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="w-100"></div>
                        <div class="col" style="height:50vh;">
                            <video width="95%" height="95%" controls><source src="video.mp4" type="video/mp4"></video>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script src="renderer.js"></script>
</html>

Is it possible make each grid like self container which have its own area?

biladina
  • 137
  • 1
  • 11

1 Answers1

1

I would add wrappers for you divs. Now your content should not overflow its wrapper. This should work.. :)

For example:

<div class="row">
  <div class="div-wrap" style="overflow:hidden; height: 'your-height';">
    <div class="col">
      ...content
    </div>
  </div>
</div>
Martin Homola
  • 255
  • 1
  • 12