Generate a dynamic table - javascript and HTML

Developer
Size
1,923 Kb
Views
26,312

How do I make an generate a dynamic table - javascript and html?

What is a generate a dynamic table - javascript and html? How do you make a generate a dynamic table - javascript and html? This script and codes were developed by Khalid Munir on 26 August 2022, Friday.

Generate a dynamic table - javascript and HTML Previews

Generate a dynamic table - javascript and HTML - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Generate a dynamic table - javascript and HTML</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <table id="out">
</table> <script src="js/index.js"></script>
</body>
</html>

Generate a dynamic table - javascript and HTML - Script Codes CSS Codes

input{width:50px}
table { border:1px solid black; border-color:red;
}

Generate a dynamic table - javascript and HTML - Script Codes JS Codes

document.body.onload = makeTable;
function makeTable() {
var tab = document.getElementById("out");
console.log(tab);
for(var r=0;r<6;r++) { var dRow = tab.insertRow(-1); for(var c=0;c<10;c++) { // for each cell - generate a html element by using add child. var cell = dRow.insertCell(-1); var newInput = document.createElement("input"); newInput.type = "text"; newInput.className = "css-class-name"; // set the CSS class newInput.setAttribute("id",c); if(c % 2) { newInput.setAttribute("data-formula", r.toString()+c); newInput.setAttribute("value", r.toString()+c); } else { newInput.setAttribute("value", r.toString()+c); } cell.appendChild(newInput); // put it into the DOM //cell.appendChild(); }
}
}
Generate a dynamic table - javascript and HTML - Script Codes
Generate a dynamic table - javascript and HTML - Script Codes
Home Page Home
Developer Khalid Munir
Username khalidmunir
Uploaded August 26, 2022
Rating 3
Size 1,923 Kb
Views 26,312
Do you need developer help for Generate a dynamic table - javascript and HTML?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Khalid Munir (khalidmunir) Script Codes
Create amazing SEO content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!