Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions Pagina.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documento</title>
<link rel="stylesheet" href="style.css">
<script src="functions.js"></script>
</head>
<body>
<div class="container">

<div class="header">
<h1>CONVERSOR DE CSV PARA TABELA HTML</h1>
</div>

<div class="main">
<div class="CSV">
<div class="button_CSV" onclick="HTMLtabela();">
<h2>Converter tabela</h2>
</div>

<div class="content_CSV">

<div id="tabelaArea">

</div>

<div id="tabelaInfo">
<p>Nome da tabela</p> <textarea id="tabelaName" cols="40" rows="1"></textarea>
<p>Tabela formato CSV:</p> <textarea id="CSV_text" cols="40" rows="5"></textarea>
</div>

</div>
</div>

<div class="IMG">
<div class="button_IMG" onclick="imageToText();">
<h2>Coverter imagem</h2>
</div>

<div id="content_IMG">
<img src="gigachadDAW.jpg" alt=" img_1 |">
</div>

</div>
</div>

</div>


</body>
</html>
44 changes: 44 additions & 0 deletions functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
function HTMLtabela() {

let CSV_text = document.getElementById("CSV_text").value.toString();
let tabelaArea = document.getElementById("tabelaArea");
let tabelaLinhas = CSV_text.split("\n");

let tabelaNome = document.createElement("h2");
let tabela = document.createElement("Tabela");

tabelaNome.appendChild( document.createTextNode( document.getElementById( "tabelaNome" ).value.toString() ) )
tabelaArea.appendChild(tabelaNome);

tabelaLinhas.forEach( (linhas) => {
let column = line.toString().split(", ");
let tabelaLine = document.createElement("tr");

column.forEach( (element) => {
let tabelaElement = document.createElement("td");
tabelaLinhas.appendChild(tabelaElement);
tabelaElement.appendChild(document.createTextNode(element));
} )

tabela.appendChild(tabelaLinhas);

} )

}

function getElementsByTagName(tag) {

}

function imageToText() {
let Images = document.getElementsByTagName("img");
let ImagesList = [...Images]
console.log(ImagesList);
ImagesList.forEach( (image) => {

let imageDescription = document.createElement("p");
imageDescription.appendChild( document.createTextNode( image.alt.toString() ) );
image.parentElement.appendChild(imageDescription);
image.parentElement.removeChild(image);
} )
}
166 changes: 166 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
* {
margin: 0;
padding: 0;
}

.container {
width: 100vw;
height: 100vh;

display: flex;
align-items: center;
flex-direction: column;
background-color: #999;
color: #999;
}

.header {
width: 100%;
padding: 35px;
text-align: center;

border-bottom: 4px solid #0527bb;
background-color: rgb(36, 35, 35);
}

.main {
width: 100%;
height: 100%;

display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}

.CSV {
width: 100%;
height: 100%;

display: flex;
align-items: center;
flex-direction: column;

border: 4px solid #3607b6;
}

.IMG {
width: 100%;
height: 100%;

display: flex;
align-items: center;
flex-direction: column;

border: 2px solid #4605bd;
}

.button_CSV, .button_IMG {
width: 20%;

padding: 1%;
margin-top: 100px;
margin-bottom: 100px;

display: flex;
align-items: center;
justify-content: center;
flex-direction: column;

font-size: small;
text-align: center;

border: 5px;
border-radius: 5px;

background-color: #0f90cc;
color: black;
}

.content_CSV {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;

width: 70%;
padding: 1%;

color: black;

}

#content_IMG {
display: flex;
align-items: center;
justify-content: center;
flex-direction: row;

width: 90%;
padding: 1%;

color: black;

}

#tabelaArea {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;

width: 90%;
padding: 2%;

border-radius: 3px;

color: black;

text-align: center;
}

#tabelaInfo {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;

width: 90%;
padding: 2%;
}


#CSV_text {
display: flex;
width: 30%;
height: 100px;
}

#tabelaName {
display: flex;
}

.button_CSV:hover, .button_IMG:hover {
box-shadow: 0px 0px 90px rgb(8, 8, 8);
transition: all 0.2s ease-in;
transform: scale(1.1);
}

tabela {
border: 2px solid black;
border-radius: 10px;
border-collapse: collapse;
width: 100%;
text-align: center;
}

td {
border: 2px solid rgb(5, 24, 77);
text-align: center;
padding: 8px;
}

img {
min-width: 90px;
max-width: 90px;
}