0

I have problem the elements is hidden in screen when add a lot data , check image below.

enter image description here

You can focus on the top You will notice elements that do not appear completely.

.container {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.container div:first-of-type {
  width: 100%;
  height: 100vh;
  position: fixed;
  background-color: #f4f4f4;
}

.container .card {
  width: fit-content;
  height: auto;
  display: table;
  background-color: #00bce9;
  border-radius: 10px;
  box-shadow: 5px 5px 10px #e6e6e7;
}

.container .card h1:first-of-type {
  width: auto;
  height: fit-content;
  margin: 5px 25px 10px 25px;
  text-align: right;
  color: #606060;
}

.container .card table {
  width: 100%;
  height: 100%;
}

.container .card table tr {
  width: 100%;
  height: 100%;
}

.container .card table tr td {
  padding: 25px;
  color: #606060;
  font-size: 1em;
  cursor: pointer;
}

.container h3:first-of-type {
  width: fit-content;
  height: auto;
  padding: 10px;
  background-color: #b8e986;
  border-radius: 0 0 10px 10px;
  box-shadow: 5px 5px 10px #e6e6e7;
  color: #606060;
  cursor: pointer;
}
<div class="container">
  <div></div>
  <div class="card">
    <table>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      <tr>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
        <td>Test</td>
      </tr>
      </tr>
    </table>
  </div>
  <h1 style="z-index: 99">aaaaaaaaa</h1>
</div>

Before post here I found this Issue when centering vertically with flexbox when heights are unknown but It's not working with me never I'll be happy if you help me because I searched 2 days ago

fen1x
  • 5,616
  • 6
  • 28
  • 39

1 Answers1

0

Try:

 .container {
   width: 100%;
  /* removed height */
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: center
}

Also, it looks like you have an extra </tr> above your closing </table>

pmarre
  • 93
  • 1
  • 9