我正在尝试使用JavaScript函数动态生成Bootstrap列。目标是将它们显示在单行中作为不同的列。
你认为可能出了什么问题?
![enter image description here](https://istack.dev59.com/50xDo.webp)
目前它的样子是这样的:
我正在使用div id在window.onload()上调用此函数:
// 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组件只是:
<lead>Completed Tasks</lead>
<div class="container" id="ongoingTasksContainer">
你认为可能出了什么问题?