<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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7730 | 10년 전 | 1279 | ||
| 7729 | 10년 전 | 1090 | ||
| 7728 |
잘살아보자
|
10년 전 | 556 | |
| 7727 |
잘살아보자
|
10년 전 | 460 | |
| 7726 |
잘살아보자
|
10년 전 | 796 | |
| 7725 |
잘살아보자
|
10년 전 | 523 | |
| 7724 |
잘살아보자
|
10년 전 | 431 | |
| 7723 |
잘살아보자
|
10년 전 | 498 | |
| 7722 |
잘살아보자
|
10년 전 | 439 | |
| 7721 |
잘살아보자
|
10년 전 | 472 | |
| 7720 |
잘살아보자
|
10년 전 | 412 | |
| 7719 |
비긴어게인
|
10년 전 | 656 | |
| 7718 |
|
10년 전 | 2500 | |
| 7717 |
잘살아보자
|
10년 전 | 633 | |
| 7716 |
잘살아보자
|
10년 전 | 371 | |
| 7715 |
잘살아보자
|
10년 전 | 409 | |
| 7714 |
잘살아보자
|
10년 전 | 444 | |
| 7713 | 10년 전 | 1748 | ||
| 7712 | 10년 전 | 1684 | ||
| 7711 | 10년 전 | 1069 | ||
| 7710 | 10년 전 | 1352 | ||
| 7709 | 10년 전 | 1482 | ||
| 7708 | 10년 전 | 1434 | ||
| 7707 | 10년 전 | 827 | ||
| 7706 |
별지기천사
|
10년 전 | 548 | |
| 7705 | 10년 전 | 1048 | ||
| 7704 |
ICONdesignstudio
|
10년 전 | 593 | |
| 7703 | 10년 전 | 557 | ||
| 7702 |
|
10년 전 | 686 | |
| 7701 | 10년 전 | 1384 | ||
| 7700 | 10년 전 | 1081 | ||
| 7699 | 10년 전 | 562 | ||
| 7698 | 10년 전 | 1108 | ||
| 7697 | 10년 전 | 5119 | ||
| 7696 | 10년 전 | 611 | ||
| 7695 | 10년 전 | 1652 | ||
| 7694 | 10년 전 | 1019 | ||
| 7693 | 10년 전 | 1514 | ||
| 7692 | 10년 전 | 1252 | ||
| 7691 | 10년 전 | 783 | ||
| 7690 | 10년 전 | 1367 | ||
| 7689 | 10년 전 | 982 | ||
| 7688 | 10년 전 | 562 | ||
| 7687 |
파랑새1597
|
10년 전 | 556 | |
| 7686 | 10년 전 | 803 | ||
| 7685 | 10년 전 | 1327 | ||
| 7684 | 10년 전 | 774 | ||
| 7683 | 10년 전 | 1023 | ||
| 7682 | 10년 전 | 910 | ||
| 7681 | 10년 전 | 622 | ||
| 7680 | 10년 전 | 964 | ||
| 7679 | 10년 전 | 458 | ||
| 7678 | 10년 전 | 697 | ||
| 7677 | 10년 전 | 597 | ||
| 7676 |
|
10년 전 | 916 | |
| 7675 |
|
10년 전 | 1119 | |
| 7674 | 10년 전 | 1030 | ||
| 7673 | 10년 전 | 728 | ||
| 7672 | 10년 전 | 1059 | ||
| 7671 | 10년 전 | 851 | ||
| 7670 | 10년 전 | 613 | ||
| 7669 |
mashmellow
|
10년 전 | 1203 | |
| 7668 | 10년 전 | 682 | ||
| 7667 | 10년 전 | 965 | ||
| 7666 |
senseme
|
10년 전 | 627 | |
| 7665 | 10년 전 | 480 | ||
| 7664 | 10년 전 | 1871 | ||
| 7663 |
mixx애교
|
10년 전 | 956 | |
| 7662 | 10년 전 | 997 | ||
| 7661 |
hkhkah
|
10년 전 | 759 | |
| 7660 | 10년 전 | 1039 | ||
| 7659 |
커네드커네드
|
10년 전 | 909 | |
| 7658 |
바람돌이팡
|
10년 전 | 639 | |
| 7657 | 10년 전 | 1138 | ||
| 7656 | 10년 전 | 1544 | ||
| 7655 | 10년 전 | 955 | ||
| 7654 |
개발짜증나
|
10년 전 | 835 | |
| 7653 |
네이비칼라
|
10년 전 | 868 | |
| 7652 |
밥먹고합시다
|
10년 전 | 787 | |
| 7651 |
플라이SINJI
|
10년 전 | 1489 | |
| 7650 |
개발짜증나
|
10년 전 | 1382 | |
| 7649 | 10년 전 | 432 | ||
| 7648 |
이미영ㅇㅇ
|
10년 전 | 837 | |
| 7647 | 10년 전 | 411 | ||
| 7646 | 10년 전 | 776 | ||
| 7645 | 10년 전 | 2275 | ||
| 7644 | 10년 전 | 795 | ||
| 7643 |
|
10년 전 | 2840 | |
| 7642 | 10년 전 | 1492 | ||
| 7641 | 10년 전 | 1109 | ||
| 7640 |
개발짜증나
|
10년 전 | 453 | |
| 7639 |
|
10년 전 | 794 | |
| 7638 |
개발짜증나
|
10년 전 | 1097 | |
| 7637 | 10년 전 | 1517 | ||
| 7636 | 10년 전 | 2881 | ||
| 7635 | 10년 전 | 1663 | ||
| 7634 | 10년 전 | 1828 | ||
| 7633 | 10년 전 | 2299 | ||
| 7632 | 10년 전 | 3899 | ||
| 7631 |
|
10년 전 | 1507 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기