Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

197
Visualizações
how to set select box width based on child table width - css

In my vue application, i have designed one select box which is having table component. While clicking the select box, table is visible in container. Now, problem is that i am not able to set dynamic width of select box based on table width.

Now, table rows are overlapping because of fixed width of select box. It is opening the container upside. There is a scroll because of width.

Here is my code

    <div class="dropdown_grid my-dropdown--medium>
 ... div related to title and toggle
 
 // here is the container
 <div
      class="dropdown_grid_container"
      ref="floating"
      v-ur-attach-root:fit
      v-click-outside.anchor="close"
    >
    <ul><li><my-table :items="items" :headers="headers"
                    single-select></my-table></li></ul>
    </div>
</div>

Css for this

    .dropdown_grid {
  display: inline-block;
  position: relative;
  min-width: 150px;
  width: 100%;
  color: #333333;
  cursor: pointer;
}

.dropdown_grid_container {
  width: 100%;
  position: absolute;
  margin-top: -1px;
  min-width: 500px;
  overflow-y: auto;
  background-color: #FFFFFF;
  border: 1px solid #959595;
  z-index: 200;
  max-height: 200px;
  padding: 8px 1px;
  margin-left: 2px;
}

.my-dropdown--medium {
  font-size: 14px;
  line-height: 24px;
  height: 32px

I have seen multiple post regarding this but not able to set it dynamic width. How to make it dynamic based on child width?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda