Dynamically create Bootstrap grid


Swopnilnep

I'm trying to dynamically generate bootstrap columns using a javascript function. The purpose is to make them appear as different columns in the same row.enter image description here

It currently looks like this:

I call this function on window.onload() with the div id:

// Update the bootstrap grid once the tasks are added
function updateTaskContainerHead(containerId){
    let containerHead = document.getElementById(containerId);
    // Take the row headings and make an HTML container out of them
    let tblRowHeadings = ['Task Name','Assigned To','Priority','Due Date',''];
    let tblHeadRow = document.createElement("div");
    tblHeadRow.classname="row";
    for (let heading of tblRowHeadings){
        let tblHeadCell = document.createElement("div");
        tblHeadCell.className="col";
        let cellText = document.createTextNode(heading);
        tblHeadCell.appendChild(cellText);
        tblHeadRow.appendChild(tblHeadCell);
    }
    containerHead.appendChild(tblHeadRow);
}

HTML components are just:

<lead>Completed Tasks</lead>
<div class="container" id="ongoingTasksContainer">

What do you think might be the problem?

David Bray

Just a spelling.. the case sensitive one:

tblHeadRow.classname="row";

should:

tblHeadRow.className="row";

Related


Dynamically create Bootstrap grid

Swopnilnep I'm trying to dynamically generate bootstrap columns using a javascript function. The purpose is to make them appear as different columns in the same row. It currently looks like this: I call this function on window.onload() with the div id: // Upda

Dynamically create Bootstrap grid

Swopnilnep I'm trying to dynamically generate bootstrap columns using a javascript function. The purpose is to make them appear as different columns in the same row. It currently looks like this: I call this function on window.onload() with the div id: // Upda

Dynamically create Bootstrap grid

Swopnilnep I'm trying to dynamically generate bootstrap columns using a javascript function. The purpose is to make them appear as different columns in the same row. It currently looks like this: I call this function on window.onload() with the div id: // Upda

How to create a bootstrap grid?

Facebook Facebook logo Sign up for Facebook to connect with Siti Rahmah I have a problem making a layout boostrap. I want to do something like this: Is there something wrong with my script? <div class="row"> <div class="col-md-12"> <div cla

react - create grid with bootstrap

Gaurang Shah I am trying to create a website and trying to create a grid. Since I'm not good at CSS, I'm using bootstrap. However, I can't figure out how to create a grid from the array of images I have to make it reactive as well. import Container from 'react

How to create a bootstrap grid?

Facebook Facebook logo Sign up for Facebook to connect with Siti Rahmah I have a problem making a layout boostrap. I want to do something like this: Is there something wrong with my script? <div class="row"> <div class="col-md-12"> <div cla

react - create grid with bootstrap

Gaurang Shah I am trying to create a website and trying to create a grid. Since I'm not good at CSS, I'm using bootstrap. However, I can't figure out how to create a grid from the array of images I have to make it reactive as well. import Container from 'react

Dynamically create bootstrap selectors

Enchantment Glory I am using bootstrap select plugin . I'm populating a dynamically created select like this: var select = $('<select/>', { 'class':"selectpicker" }).selectpicker(); for (var idx in data) { if (data.hasOwnProperty(idx)) { sele

Dynamically create bootstrap selectors

Enchantment Glory I am using bootstrap select plugin . I'm populating a dynamically created select like this: var select = $('<select/>', { 'class':"selectpicker" }).selectpicker(); for (var idx in data) { if (data.hasOwnProperty(idx)) { sele

How to create a grid dynamically in unity

Samsung My vertices have color values. I want to make a mesh using vertices with the same color value. This photo is an example. I took a picture with an android phone and did an image segmentation of the object So I get a color value corresponding to the coor

How to create a dynamically changing grid?

Uncle Bear What I'm trying to say at the beginning is that I'm just starting my adventures with Xaml, so please understand if the question is trivial. I'm going to design a user control with variable layout, which is controlled by radio buttons in a UWP - C++C

Java dynamically create button in grid

Hassett I am creating a desktop application in Java in which I want to create buttons dynamically. Dynamically created buttons should be placed in a grid-like structure. Now, my concern is, if I want to access these buttons, what should I do since I don't have

Java dynamically create button in grid

Hassett I am creating a desktop application in Java in which I want to create buttons dynamically. Dynamically created buttons should be placed in a grid-like structure. Now, my concern is, if I want to access these buttons, what should I do since I don't have

Create Bootstrap grid with JS loop

black sun I'm looking to iterate over a JSON array and print the result within one row (3 equal columns). The actual approach doesn't respect the logic behind bootstrap, so how do I tell the JS to only include 3 elements and then clone a div like that. Here is

Create a grid of tiles in Bootstrap 3

Jesse Orange I'm working on a project where users are asking if they can have something like this. Gridlines are used as a guide. I know I can use columns, but the item that trips me up is the longer image. Is there a way to make a row span many rows? Or is it

Dynamically create item in dropdown in bootstrap

username A small part of my html code: <div class="text-center"> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> Platforms <span class="caret"></span>

Dynamically create item in dropdown in bootstrap

username A small part of my html code: <div class="text-center"> <div class="btn-group"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> Platforms <span class="caret"></span>

React.js - Dynamically create grid with HTML

Alejandro Currently, I'm working on an FCC project called "The Game of Life" Before starting, I was simply working on how to render the grid onto the page. I want to be able to change the dimensions of the table while still staying in the container the table i

Dynamically create grid layout with div tags in PHP

David Diaz So I had a similar problem to one , but I only applied it in vanilla PHP, not WordPress. After countless hours of struggle, I finally found the answer, but if I increase the size of the grid number, the items won't align. I want it to look like this

Dynamically create grid for Angular in Kendo UI

ps0604 Kendo UI for Angular has a grid that can be defined as follows: <kendo-grid [data]="gridData" [height]="410"> <kendo-grid-column field="ProductID" title="ID" width="40"> </kendo-grid-column> <kendo-grid-column field="

Dynamically create grid for Angular in Kendo UI

ps0604 Kendo UI for Angular has a grid that can be defined as follows: <kendo-grid [data]="gridData" [height]="410"> <kendo-grid-column field="ProductID" title="ID" width="40"> </kendo-grid-column> <kendo-grid-column field="

React.js - Dynamically create grid with HTML

Alejandro Currently, I'm working on an FCC project called "The Game of Life" Before starting, I was simply working on how to render the grid onto the page. I want to be able to change the dimensions of the table while still staying in the container the table i

React.js - Dynamically create grid with HTML

Alejandro Currently, I'm working on an FCC project called "The Game of Life" Before starting, I was simply working on how to render the grid onto the page. I want to be able to change the dimensions of the table while still staying in the container the table i

Dynamically create grid in Xamarin.Forms

Don Joe I'm currently testing the app to list products, but I'm having an issue where the grid cannot be dynamically generated with the corresponding content (only for labels at the moment). I want to generate them as soon as the main page is called. I've gone

Dynamically create grid layout with div tags in PHP

David Diaz So I had a similar problem to one , but I only applied it in vanilla PHP, not WordPress. After countless hours of struggle, I finally found the answer, but if I increase the size of the grid number, the items won't align. I want it to look like this

Dynamically create grid layout with div tags in PHP

David Diaz So I had a similar problem to one , but I only applied it in vanilla PHP, not WordPress. After countless hours of struggle, I finally found the answer, but if I increase the size of the grid number, the items won't align. I want it to look like this