JSFiddle - React, Tailwind, and code Playground
by Rapha Souza
HTML
<script src="https://code.jquery.com/jquery-3.4.1.slim.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.css">
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h2>Cell that spans two columns</h2>
<p>To make a cell span more than one column, use the colspan attribute.</p>
<table style="width:100%">
<tr>
<th>Controle</th>
<td id="ct0">Bill Gates</td>
<td id="ct1">55577854</td>
<td id="ct2">55577854</td>
<td id="ct3">55577854</td>
</tr>
<tr>
<th>Financeiro</th>
<td id="t1">Bill Gates</td>
<td id="t2">55577854</td>
<td id="t3">55577854</td>
</tr>
<tr>
<th>Executivo</th>
<td id="a1">Bill Gates</td>
<td id="a2">55577854</td>
<td id="a3">55577854</td>
</tr>
<tr>
<th>Executivo</th>
<td id="z1">Bill Gates</td>
<td id="z2">55577854</td>
<td id="z3">55577854</td>
</tr>
</table>
<p>Click the button to add a new element to the array.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo0"></p>
<p id="demo1"></p>
<p id="demo2"></p>
<p id="demo3"></p>
<p id="demo4"></p>
</body>
</html>
CSS
table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
th, td {
padding: 5px;
text-align: left;
}
JavaScript
var fruits = ["Apple", "Controle", "Financeiro", "Mango"];
//var pasta = ["teste"]
document.getElementById("demo").innerHTML = fruits;
function myFunction() {
var pasta = ["Diretoria","GETEL","GEAUDI","GEMED"];
// alert(pasta.length)
//Controle
var j = 0
for(var i = 0; i <= pasta.length; i++){
j++
//var pasta = ["Diretoria","GETEL","GEAUDI"];
//alert("ind = "+indice)
document.getElementById("ct" + i).innerHTML = pasta[i] + i;
//alert(i)
//alert(pasta.length)
}
for(var j = 1; j<=3; j ++){
//alert(pasta[j])
}
}