Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
Creating column divs in JS, but they are rendering as rows instead

I am building a Jeopardy game (following a tutorial)The code is throwing no errors but my JS div element header columns for my categories are not displaying in columns they display in rows as well as my clue boxes with not properly align into columns

I have my JS script at the bottom of my page, I have deconstructed and reconstructed the code to try and pinpoint my issue with no luck.

for a visual here is the codepen link: https://codepen.io/NP27/pen/zYELarE

Code is as follows:

    <title>Document</title>
</head>
<body>
   <div class="app">
    <header class="top-header">
        <h1>Trivia Game Show</h1>
        <p class="score">Score <span class="score-count"></span></p>
    </header>

    <!--container for the board-->
  <div class="board"></div> 
    <!--categories get injected here-->
    
   

CSS:

 * {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: sans-serif;

    color: white;
    font-size: 2vw;
    text-align: center;
    padding: 1em;
    background: linear-gradient(180deg, #2e2e3a 0%, #0c0c2c 100%);

}
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-shadow: var(--text-shadow);
}

JS Script :

renderCategory(category) {
    let column = document.createElement("div");
    column.classList.add("column");

    column.innerHTML = (
       `<header>${category.title}</header><ul></ul>`
    )
   

    this.boardElement.appendChild(column);
   

    
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda