Last active
November 2, 2018 18:56
-
-
Save gknasln/9a2370cac7412c38f063b8a7682749a1 to your computer and use it in GitHub Desktop.
Untitled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body{ | |
background: rgb(220, 200, 200); | |
} | |
.container{ | |
width: 100%; | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
} | |
#excel-table{ | |
border: none; | |
column-space: 0; | |
} | |
#excel-table tr:nth-child(1){ | |
background: aliceblue; | |
} | |
tr{ | |
border-bottom: 1px solid black; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<table id="excel-table"> | |
<tr id="area-row"></tr> | |
</table> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = ['Kayıt tarihi', 'isim', 'telefon', 'email']; | |
function createTitles(titles){ | |
var areaRow= document.getElementById('area-row'); | |
areaRow.innerHTML = ''; | |
for(let i = 0; i < titles.length; i++){ | |
var newCell = newRow.insertCell(areaRow.cells.length); | |
var text = document.createTextNode(titles[i]); | |
newCell.appendChild(text); | |
} | |
} | |
alert(findFieldName(data[1])); | |
function findFieldName(word){ | |
if(!word || word == ''){ | |
return 'empty'; | |
} else if(checkNameField(word)){ | |
return 'name'; | |
} else { | |
return false; | |
} | |
} | |
function checkNameField(data){ | |
var word = data.toLowerCase(); | |
if(word == 'name'){ | |
return true; | |
}else if(word == 'isim'){ | |
return true; | |
}else if(word == 'ismi'){ | |
return true; | |
}else if(word == 'ad'){ | |
return true; | |
}else if(word == 'adı'){ | |
return false; | |
} | |
} | |
function checkSurnameField(data){ | |
const word = data.toLowerCase(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"javascript"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment