<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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7630 | 10년 전 | 652 | ||
| 7629 |
|
10년 전 | 2391 | |
| 7628 | 10년 전 | 793 | ||
| 7627 |
|
10년 전 | 1032 | |
| 7626 |
|
10년 전 | 1788 | |
| 7625 | 10년 전 | 711 | ||
| 7624 | 10년 전 | 728 | ||
| 7623 |
|
10년 전 | 3094 | |
| 7622 | 10년 전 | 728 | ||
| 7621 |
leeleeleelee
|
10년 전 | 586 | |
| 7620 | 10년 전 | 540 | ||
| 7619 | 10년 전 | 491 | ||
| 7618 | 10년 전 | 1026 | ||
| 7617 | 10년 전 | 726 | ||
| 7616 | 10년 전 | 650 | ||
| 7615 | 10년 전 | 727 | ||
| 7614 | 10년 전 | 1264 | ||
| 7613 |
|
10년 전 | 2085 | |
| 7612 | 10년 전 | 1146 | ||
| 7611 | 10년 전 | 1418 | ||
| 7610 |
|
10년 전 | 1904 | |
| 7609 |
|
10년 전 | 1345 | |
| 7608 |
mwdkim
|
10년 전 | 1131 | |
| 7607 |
|
10년 전 | 1054 | |
| 7606 |
mwdkim
|
10년 전 | 3928 | |
| 7605 | 10년 전 | 693 | ||
| 7604 | 10년 전 | 1028 | ||
| 7603 | 10년 전 | 1654 | ||
| 7602 |
|
10년 전 | 1078 | |
| 7601 |
AniNest
|
10년 전 | 2793 | |
| 7600 |
port443
|
10년 전 | 1034 | |
| 7599 | 10년 전 | 947 | ||
| 7598 | 10년 전 | 1022 | ||
| 7597 | 10년 전 | 4577 | ||
| 7596 |
SeungYeon
|
10년 전 | 893 | |
| 7595 |
untitled
|
10년 전 | 2426 | |
| 7594 |
프로그래머7
|
10년 전 | 1731 | |
| 7593 |
untitled
|
10년 전 | 2366 | |
| 7592 |
untitled
|
10년 전 | 1944 | |
| 7591 |
untitled
|
10년 전 | 2678 | |
| 7590 |
아리마2001
|
10년 전 | 854 | |
| 7589 | 10년 전 | 1111 | ||
| 7588 |
|
10년 전 | 2921 | |
| 7587 | 10년 전 | 1305 | ||
| 7586 | 10년 전 | 672 | ||
| 7585 | 10년 전 | 1696 | ||
| 7584 | 10년 전 | 1414 | ||
| 7583 |
leeleeleelee
|
10년 전 | 1164 | |
| 7582 |
|
10년 전 | 1114 | |
| 7581 | 10년 전 | 1350 | ||
| 7580 | 10년 전 | 998 | ||
| 7579 |
|
10년 전 | 610 | |
| 7578 | 10년 전 | 1431 | ||
| 7577 |
|
10년 전 | 1872 | |
| 7576 | 10년 전 | 1387 | ||
| 7575 |
멋진남자임
|
10년 전 | 1465 | |
| 7574 | 10년 전 | 2123 | ||
| 7573 | 10년 전 | 3259 | ||
| 7572 | 10년 전 | 761 | ||
| 7571 |
|
10년 전 | 784 | |
| 7570 |
|
10년 전 | 1318 | |
| 7569 | 10년 전 | 1553 | ||
| 7568 |
this1mg
|
10년 전 | 1053 | |
| 7567 |
|
10년 전 | 764 | |
| 7566 | 10년 전 | 918 | ||
| 7565 |
Angel하늘
|
10년 전 | 1010 | |
| 7564 |
seoldi
|
10년 전 | 1241 | |
| 7563 |
|
10년 전 | 1385 | |
| 7562 |
멋진남자임
|
10년 전 | 2088 | |
| 7561 | 10년 전 | 714 | ||
| 7560 |
leeleeleelee
|
10년 전 | 905 | |
| 7559 | 10년 전 | 5049 | ||
| 7558 |
RinaP
|
10년 전 | 786 | |
| 7557 |
|
10년 전 | 1247 | |
| 7556 | 10년 전 | 1194 | ||
| 7555 |
hyohyojj1234
|
10년 전 | 1666 | |
| 7554 | 10년 전 | 1094 | ||
| 7553 |
senseme
|
10년 전 | 1340 | |
| 7552 |
ehdltdoit
|
10년 전 | 1437 | |
| 7551 |
|
10년 전 | 1826 | |
| 7550 |
leeleeleelee
|
10년 전 | 1593 | |
| 7549 | 10년 전 | 2426 | ||
| 7548 | 10년 전 | 1845 | ||
| 7547 |
멋진남자임
|
10년 전 | 1963 | |
| 7546 | 10년 전 | 1006 | ||
| 7545 |
ILMare1003
|
10년 전 | 1292 | |
| 7544 |
|
10년 전 | 1254 | |
| 7543 | 10년 전 | 886 | ||
| 7542 | 10년 전 | 657 | ||
| 7541 |
울라라라우
|
10년 전 | 866 | |
| 7540 | 10년 전 | 1600 | ||
| 7539 | 10년 전 | 936 | ||
| 7538 |
|
10년 전 | 1834 | |
| 7537 | 10년 전 | 3611 | ||
| 7536 |
Gaumi
|
10년 전 | 1416 | |
| 7535 |
프로그램은어려워
|
10년 전 | 1275 | |
| 7534 |
senseme
|
10년 전 | 1207 | |
| 7533 | 10년 전 | 1201 | ||
| 7532 | 10년 전 | 859 | ||
| 7531 | 10년 전 | 2057 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기