diff --git a/TabelaJS.js b/TabelaJS.js new file mode 100644 index 0000000..41cd737 --- /dev/null +++ b/TabelaJS.js @@ -0,0 +1,32 @@ +function tabelaHTML(){ + + let tabela_csv = document.getElementById("input").value; + let tabela_pronta = document.getElementById("tabela_pronta"); + + tabela_pronta.innerHTML = ""; + + let tabela = document.createElement("table"); + let tabelaHTML = tabela_csv.split("\n"); + + tabelaHTML.forEach(linha_tabela => { + + let item = linha_tabela.toString().split(","); + let linha = document.createElement("tr"); + + item.forEach(palavra => { + + let texto = document.createElement("td"); + let noTexto = document.createTextNode(palavra); + + texto.appendChild(noTexto); + linha.appendChild(texto); + + }) + + tabela.appendChild(linha); + + }); + + tabela_pronta.appendChild(tabela); + +} \ No newline at end of file diff --git a/meuGetElementByID.js b/meuGetElementByID.js new file mode 100644 index 0000000..c7bc176 --- /dev/null +++ b/meuGetElementByID.js @@ -0,0 +1,23 @@ +function elementoPorID(no, parametro){ + + let vetor_de_elementos = [], i; + + for(i = 0; i < no.childNodes.length; i++){ + + let noFilho = no.childNodes[i]; + + if(noFilho.childNodes.length > 0){ + + elementoPorID(noFilho, parametro); + } + + if(noFilho.tagName == parametro){ + + vetor_de_elementos.push(noFilho); + + } + + } + + return vetor_de_elementos; + } \ No newline at end of file diff --git a/siteJS.css b/siteJS.css new file mode 100644 index 0000000..2f74bd1 --- /dev/null +++ b/siteJS.css @@ -0,0 +1,22 @@ +#titulo{ + + padding-top: 1em; + text-align: center; + background-color: rgb(43, 100, 43); + width: 100%; + height: 2em; + border-radius: 25px; +} + +#tabela_pronta{ + + padding-top: 10em; + +} + +tr, td{ + + border: 1px solid black; + padding: 0.5em; + +} \ No newline at end of file diff --git a/siteTabela.html b/siteTabela.html new file mode 100644 index 0000000..c7fac1b --- /dev/null +++ b/siteTabela.html @@ -0,0 +1,24 @@ + + +
+ + + + + +