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

327
Visualizações
Javascript, TailwindCSS - How can i place those buttons next to each other

I'm trying to get those buttons and iframes to be next to each other instead of being vertical.

Image

They are those on the right side of the window. As you can see they are ordered vertically instead of horizontally. I want to make it so that you can switch from one button to the other and make the other one not display the element like the ones on the left (you click on one of those two buttons and it will display a different chart and make the other one invisible). Instead ,in this one, i want them to display a different iframe for each button.

I already did this:

function createIframes() {
for (let i = 0; i < spectra_list.length; i++) {
    let button = document.createElement("button");
    let iframe = document.createElement("iframe");
    button.innerText = "Spectre "+ (i+1);
    button.style.backgroundColor = colors[i];
    button.classList.add("h-10", "py-1", "text-xl", "text-gray-100", "font-medium", "transition-colors", "hover:text-gray-900", "focus:outline-none", "display:inline-block");
    iframe.classList.add("h-full", "border-gray-400", "rounded-r", "bg-gray-50","display:inline-block");
    div_header.appendChild(button);
    div_header.appendChild(iframe);
    let buttons = [button];
    let iframes = [iframe];
    button.addEventListener("click", function (){
        ////
    })
}

Next i have the HTML:

 <div class="flex flex-row justify-center my-4">
     <div class="relative w-1/2 flex flex-col mr-1" id="div-header-overplot">
        // buttons and iframes here
     </div>
 </div>
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You should replace flex-col with flex-row in the inner DIV (div-header-overplot).

about 4 years ago · Juan Pablo Isaza Relatório
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