<style>
#excel {width: 800px; height: 400px; overflow: auto; border: 1px solid #ccc}
#excel table { width: 2000px; border-spacing:0 }
#excel table th {font-weight: normal; background-color: #eee}
#excel table th, #excel table td { height: 20px; border: 1px solid #ddd; }
#excel table td {text-align: right; padding: 0; }
#excel table input {border:none; border-right:0px; border-top:0px; boder-left:0px; boder-bottom:0px; outline-style: none; font-size: 1em }
</style>
<div id="excel"></div>
<script>
function Excel(label, rows, cols) {
this.div = document.getElementById(label);
this.table = document.createElement('table');
this.rows = rows;
this.cols = cols;
this.clicked = null;
this.cells = [];
}
Excel.prototype.init = function() {
var tr = {}, el = {}, r = 0, c = 0, tr = document.createElement('tr')
for (c=0; c<this.cols; c++) {
el = document.createElement('th');
el.style.width = Math.round(100 / this.cols * 10) / 10 + '%';
if (c != 0) el.textContent = String.fromCharCode(64 + c);
tr.appendChild(el);
}
this.table.appendChild(tr);
for (r=1; r<this.rows; r++) {
tr = document.createElement('tr');
for (c=0; c<this.cols; c++) {
if (c !=0) el= document.createElement('td');
else {
el= document.createElement('th');
el.textContent = r;
}
tr.appendChild(el);
}
this.table.appendChild(tr);
}
this.div.appendChild(this.table);
};
Excel.prototype.getPos = function(obj) {
var pos = {};
pos.r = obj.parentNode.rowIndex;
pos.c = obj.cellIndex;
return pos;
}
Excel.prototype.click = function() {
var td = this, textbox, text, pos = excel.getPos(this);
if (excel.clicked != null) excel.clicked.style.border = '1px solid #ddd';
this.style.border = '1px solid blue';
excel.clicked = this;
textbox = document.createElement('input');
if (this.hasChildNodes()) {
if (this.firstChild.nodeName == 'INPUT') return;
else {
text = this.firstChild.textContent;
textbox.value = excel.cells[pos.r + ',' + pos.c];
this.removeChild(this.firstChild);
}
}
textbox.type = 'text';
textbox.style.width = (this.offsetWidth - 2) + 'px';
textbox.style.height = (this.offsetHeight - 4) + 'px';
this.appendChild(textbox);
this.firstChild.focus();
textbox.onblur = function(){
text = this.value;
this.remove(0);
excel.cells[pos.r + ',' + pos.c] = text;
if (text.match(/^=/)) text = eval( text.replace('=', '') );
td.textContent = text;
};
}
Excel.prototype.edit = function() {
var table, tr = {}, el = {}, r = 0, c = 0,
table = this.div.childNodes[0];
for (r=1; r<this.rows; r++) {
for (c=1; c<this.cols; c++) {
el = table.rows[r].cells[c];
el.onclick = this.click;
el.onkeydown = this.keydown;
}
}
};
Excel.prototype.keydown = function(e) {
var pos = excel.getPos(this), e = e || window.event;
switch (e.keyCode) {
case 38 : pos.r -= 1; break;
case 40 : case 13: pos.r += 1; break;
case 37 : pos.c -= 1; break;
case 39 : pos.c += 1; break;
}
if (pos.r < 1 || pos.r > excel.rows-1 || pos.c < 1 || pos.c > excel.cols-1) return;
excel.table.rows[pos.r].cells[pos.c].click();
};
var excel = new Excel('excel', 40, 27);
excel.init();
excel.edit();
</script>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7130 | 11년 전 | 2307 | ||
| 7129 | 11년 전 | 711 | ||
| 7128 |
senseme
|
11년 전 | 1302 | |
| 7127 | 11년 전 | 1180 | ||
| 7126 | 11년 전 | 824 | ||
| 7125 | 11년 전 | 2954 | ||
| 7124 | 11년 전 | 1428 | ||
| 7123 |
잘살아보자
|
11년 전 | 1291 | |
| 7122 |
잘살아보자
|
11년 전 | 691 | |
| 7121 |
잘살아보자
|
11년 전 | 3052 | |
| 7120 |
잘살아보자
|
11년 전 | 2920 | |
| 7119 |
잘살아보자
|
11년 전 | 736 | |
| 7118 |
잘살아보자
|
11년 전 | 3435 | |
| 7117 |
잘살아보자
|
11년 전 | 854 | |
| 7116 | 11년 전 | 751 | ||
| 7115 | 11년 전 | 1038 | ||
| 7114 | 11년 전 | 855 | ||
| 7113 | 11년 전 | 669 | ||
| 7112 | 11년 전 | 1089 | ||
| 7111 | 11년 전 | 1801 | ||
| 7110 | 11년 전 | 1036 | ||
| 7109 |
버섯먹은나
|
11년 전 | 816 | |
| 7108 | 11년 전 | 654 | ||
| 7107 | 11년 전 | 2414 | ||
| 7106 | 11년 전 | 1964 | ||
| 7105 | 11년 전 | 2487 | ||
| 7104 | 11년 전 | 1425 | ||
| 7103 |
|
11년 전 | 2715 | |
| 7102 | 11년 전 | 3124 | ||
| 7101 | 11년 전 | 4447 | ||
| 7100 | 11년 전 | 5796 | ||
| 7099 | 11년 전 | 2145 | ||
| 7098 | 11년 전 | 1729 | ||
| 7097 | 11년 전 | 1467 | ||
| 7096 | 11년 전 | 1133 | ||
| 7095 |
잘살아보자
|
11년 전 | 861 | |
| 7094 |
잘살아보자
|
11년 전 | 1067 | |
| 7093 |
잘살아보자
|
11년 전 | 943 | |
| 7092 |
잘살아보자
|
11년 전 | 1415 | |
| 7091 |
잘살아보자
|
11년 전 | 2215 | |
| 7090 |
잘살아보자
|
11년 전 | 897 | |
| 7089 | 11년 전 | 1072 | ||
| 7088 | 11년 전 | 1718 | ||
| 7087 | 11년 전 | 1414 | ||
| 7086 | 11년 전 | 1317 | ||
| 7085 |
|
11년 전 | 1240 | |
| 7084 | 11년 전 | 1158 | ||
| 7083 | 11년 전 | 3508 | ||
| 7082 | 11년 전 | 1157 | ||
| 7081 | 11년 전 | 1742 | ||
| 7080 | 11년 전 | 2026 | ||
| 7079 | 11년 전 | 1335 | ||
| 7078 | 11년 전 | 1307 | ||
| 7077 | 11년 전 | 1315 | ||
| 7076 | 11년 전 | 773 | ||
| 7075 | 11년 전 | 1157 | ||
| 7074 |
네이비칼라
|
11년 전 | 1512 | |
| 7073 | 11년 전 | 1481 | ||
| 7072 |
|
11년 전 | 836 | |
| 7071 | 11년 전 | 1211 | ||
| 7070 | 11년 전 | 939 | ||
| 7069 | 11년 전 | 1712 | ||
| 7068 | 11년 전 | 1368 | ||
| 7067 |
TPSint
|
11년 전 | 750 | |
| 7066 | 11년 전 | 2155 | ||
| 7065 | 11년 전 | 6657 | ||
| 7064 | 11년 전 | 1302 | ||
| 7063 | 11년 전 | 1146 | ||
| 7062 | 11년 전 | 1081 | ||
| 7061 | 11년 전 | 923 | ||
| 7060 | 11년 전 | 1477 | ||
| 7059 | 11년 전 | 887 | ||
| 7058 |
EngineMan
|
11년 전 | 3409 | |
| 7057 | 11년 전 | 1251 | ||
| 7056 | 11년 전 | 1642 | ||
| 7055 | 11년 전 | 1024 | ||
| 7054 | 11년 전 | 2663 | ||
| 7053 |
네이비칼라
|
11년 전 | 1292 | |
| 7052 | 11년 전 | 2585 | ||
| 7051 | 11년 전 | 1946 | ||
| 7050 | 11년 전 | 2461 | ||
| 7049 | 11년 전 | 1421 | ||
| 7048 | 11년 전 | 2541 | ||
| 7047 | 11년 전 | 1363 | ||
| 7046 | 11년 전 | 1044 | ||
| 7045 | 11년 전 | 1069 | ||
| 7044 | 11년 전 | 5442 | ||
| 7043 | 11년 전 | 1236 | ||
| 7042 | 11년 전 | 796 | ||
| 7041 |
열라뽕똬이
|
11년 전 | 766 | |
| 7040 | 11년 전 | 1119 | ||
| 7039 | 11년 전 | 1472 | ||
| 7038 | 11년 전 | 1885 | ||
| 7037 | 11년 전 | 2189 | ||
| 7036 | 11년 전 | 1094 | ||
| 7035 | 11년 전 | 1415 | ||
| 7034 | 11년 전 | 1367 | ||
| 7033 |
열라뽕똬이
|
11년 전 | 1002 | |
| 7032 | 11년 전 | 761 | ||
| 7031 | 11년 전 | 2192 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기