<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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7830 | 9년 전 | 378 | ||
| 7829 |
|
9년 전 | 554 | |
| 7828 | 9년 전 | 489 | ||
| 7827 | 9년 전 | 373 | ||
| 7826 | 9년 전 | 382 | ||
| 7825 | 9년 전 | 435 | ||
| 7824 | 9년 전 | 417 | ||
| 7823 | 9년 전 | 324 | ||
| 7822 | 9년 전 | 319 | ||
| 7821 | 9년 전 | 264 | ||
| 7820 | 9년 전 | 319 | ||
| 7819 |
|
9년 전 | 722 | |
| 7818 | 10년 전 | 336 | ||
| 7817 | 10년 전 | 456 | ||
| 7816 | 10년 전 | 357 | ||
| 7815 | 10년 전 | 564 | ||
| 7814 | 10년 전 | 389 | ||
| 7813 | 10년 전 | 333 | ||
| 7812 | 10년 전 | 347 | ||
| 7811 | 10년 전 | 362 | ||
| 7810 | 10년 전 | 494 | ||
| 7809 | 10년 전 | 438 | ||
| 7808 | 10년 전 | 303 | ||
| 7807 | 10년 전 | 362 | ||
| 7806 |
프로그래머7
|
10년 전 | 1309 | |
| 7805 | 10년 전 | 1225 | ||
| 7804 |
zahir1312
|
10년 전 | 745 | |
| 7803 |
|
10년 전 | 1346 | |
| 7802 | 10년 전 | 404 | ||
| 7801 | 10년 전 | 831 | ||
| 7800 | 10년 전 | 1053 | ||
| 7799 | 10년 전 | 507 | ||
| 7798 | 10년 전 | 455 | ||
| 7797 | 10년 전 | 453 | ||
| 7796 | 10년 전 | 304 | ||
| 7795 | 10년 전 | 455 | ||
| 7794 | 10년 전 | 480 | ||
| 7793 | 10년 전 | 1000 | ||
| 7792 | 10년 전 | 408 | ||
| 7791 | 10년 전 | 492 | ||
| 7790 | 10년 전 | 457 | ||
| 7789 |
fbastore
|
10년 전 | 1403 | |
| 7788 | 10년 전 | 488 | ||
| 7787 | 10년 전 | 355 | ||
| 7786 | 10년 전 | 509 | ||
| 7785 | 10년 전 | 527 | ||
| 7784 | 10년 전 | 593 | ||
| 7783 | 10년 전 | 393 | ||
| 7782 | 10년 전 | 448 | ||
| 7781 | 10년 전 | 852 | ||
| 7780 | 10년 전 | 780 | ||
| 7779 | 10년 전 | 748 | ||
| 7778 | 10년 전 | 316 | ||
| 7777 | 10년 전 | 401 | ||
| 7776 | 10년 전 | 406 | ||
| 7775 | 10년 전 | 341 | ||
| 7774 | 10년 전 | 602 | ||
| 7773 | 10년 전 | 323 | ||
| 7772 | 10년 전 | 669 | ||
| 7771 | 10년 전 | 329 | ||
| 7770 | 10년 전 | 614 | ||
| 7769 | 10년 전 | 332 | ||
| 7768 | 10년 전 | 548 | ||
| 7767 | 10년 전 | 1116 | ||
| 7766 | 10년 전 | 444 | ||
| 7765 | 10년 전 | 479 | ||
| 7764 |
잘살아보자
|
10년 전 | 327 | |
| 7763 |
|
10년 전 | 1400 | |
| 7762 |
Tosea
|
10년 전 | 1019 | |
| 7761 | 10년 전 | 614 | ||
| 7760 |
잘살아보자
|
10년 전 | 607 | |
| 7759 |
잘살아보자
|
10년 전 | 422 | |
| 7758 |
잘살아보자
|
10년 전 | 536 | |
| 7757 | 10년 전 | 1181 | ||
| 7756 |
ITBANK
|
10년 전 | 1218 | |
| 7755 | 10년 전 | 1896 | ||
| 7754 | 10년 전 | 1000 | ||
| 7753 | 10년 전 | 844 | ||
| 7752 | 10년 전 | 1349 | ||
| 7751 |
잘살아보자
|
10년 전 | 475 | |
| 7750 |
잘살아보자
|
10년 전 | 441 | |
| 7749 |
잘살아보자
|
10년 전 | 442 | |
| 7748 |
잘살아보자
|
10년 전 | 421 | |
| 7747 |
잘살아보자
|
10년 전 | 515 | |
| 7746 |
잘살아보자
|
10년 전 | 634 | |
| 7745 |
잘살아보자
|
10년 전 | 877 | |
| 7744 |
잘살아보자
|
10년 전 | 389 | |
| 7743 | 10년 전 | 912 | ||
| 7742 |
starbros
|
10년 전 | 787 | |
| 7741 |
잘살아보자
|
10년 전 | 608 | |
| 7740 |
잘살아보자
|
10년 전 | 479 | |
| 7739 |
잘살아보자
|
10년 전 | 437 | |
| 7738 |
잘살아보자
|
10년 전 | 490 | |
| 7737 |
잘살아보자
|
10년 전 | 449 | |
| 7736 |
잘살아보자
|
10년 전 | 471 | |
| 7735 |
잘살아보자
|
10년 전 | 802 | |
| 7734 |
잘살아보자
|
10년 전 | 396 | |
| 7733 |
잘살아보자
|
10년 전 | 498 | |
| 7732 |
잘살아보자
|
10년 전 | 653 | |
| 7731 |
잘살아보자
|
10년 전 | 579 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기