<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>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7430 |
|
11년 전 | 4928 | |
| 7429 | 11년 전 | 1752 | ||
| 7428 |
멋진남자임
|
11년 전 | 1143 | |
| 7427 |
sdflksdj2
|
11년 전 | 797 | |
| 7426 | 11년 전 | 1340 | ||
| 7425 | 11년 전 | 1366 | ||
| 7424 | 11년 전 | 1032 | ||
| 7423 |
SeungYeon
|
11년 전 | 544 | |
| 7422 | 11년 전 | 790 | ||
| 7421 |
sdflksdj2
|
11년 전 | 663 | |
| 7420 | 11년 전 | 951 | ||
| 7419 |
|
11년 전 | 1377 | |
| 7418 |
멋진남자임
|
11년 전 | 1383 | |
| 7417 | 11년 전 | 586 | ||
| 7416 |
senseme
|
11년 전 | 1200 | |
| 7415 | 11년 전 | 942 | ||
| 7414 | 11년 전 | 695 | ||
| 7413 | 11년 전 | 4829 | ||
| 7412 | 11년 전 | 4393 | ||
| 7411 |
holla
|
11년 전 | 872 | |
| 7410 | 11년 전 | 4230 | ||
| 7409 | 11년 전 | 3917 | ||
| 7408 | 11년 전 | 4260 | ||
| 7407 | 11년 전 | 5046 | ||
| 7406 | 11년 전 | 4710 | ||
| 7405 | 11년 전 | 4277 | ||
| 7404 | 11년 전 | 735 | ||
| 7403 | 11년 전 | 5658 | ||
| 7402 | 11년 전 | 1486 | ||
| 7401 |
|
11년 전 | 956 | |
| 7400 | 11년 전 | 2959 | ||
| 7399 |
멋진남자임
|
11년 전 | 891 | |
| 7398 |
파랑새1597
|
11년 전 | 2648 | |
| 7397 | 11년 전 | 2247 | ||
| 7396 |
basketball
|
11년 전 | 1337 | |
| 7395 | 11년 전 | 1586 | ||
| 7394 | 11년 전 | 913 | ||
| 7393 | 11년 전 | 2048 | ||
| 7392 | 11년 전 | 827 | ||
| 7391 |
잘살아보자
|
11년 전 | 5343 | |
| 7390 |
잘살아보자
|
11년 전 | 2207 | |
| 7389 |
잘살아보자
|
11년 전 | 3305 | |
| 7388 |
파랑새1597
|
11년 전 | 911 | |
| 7387 | 11년 전 | 1084 | ||
| 7386 |
프리랜서퍼블리셔
|
11년 전 | 956 | |
| 7385 | 11년 전 | 1558 | ||
| 7384 |
울라라라우
|
11년 전 | 876 | |
| 7383 | 11년 전 | 1532 | ||
| 7382 |
잘살아보자
|
11년 전 | 4210 | |
| 7381 |
잘살아보자
|
11년 전 | 1972 | |
| 7380 |
잘살아보자
|
11년 전 | 1923 | |
| 7379 |
잘살아보자
|
11년 전 | 5884 | |
| 7378 |
senseme
|
11년 전 | 1871 | |
| 7377 |
잘살아보자
|
11년 전 | 2715 | |
| 7376 | 11년 전 | 2387 | ||
| 7375 |
잘살아보자
|
11년 전 | 1029 | |
| 7374 |
잘살아보자
|
11년 전 | 3136 | |
| 7373 |
잘살아보자
|
11년 전 | 2463 | |
| 7372 |
잘살아보자
|
11년 전 | 5822 | |
| 7371 |
잘살아보자
|
11년 전 | 3451 | |
| 7370 |
잘살아보자
|
11년 전 | 1896 | |
| 7369 |
잘살아보자
|
11년 전 | 2151 | |
| 7368 |
ksdhtm56
|
11년 전 | 538 | |
| 7367 | 11년 전 | 1409 | ||
| 7366 | 11년 전 | 913 | ||
| 7365 | 11년 전 | 3521 | ||
| 7364 |
잘살아보자
|
11년 전 | 1371 | |
| 7363 |
잘살아보자
|
11년 전 | 1344 | |
| 7362 |
잘살아보자
|
11년 전 | 1480 | |
| 7361 | 11년 전 | 3585 | ||
| 7360 | 11년 전 | 3537 | ||
| 7359 | 11년 전 | 3362 | ||
| 7358 |
멋진남자임
|
11년 전 | 1008 | |
| 7357 | 11년 전 | 3387 | ||
| 7356 | 11년 전 | 2589 | ||
| 7355 | 11년 전 | 3161 | ||
| 7354 |
파랑새1597
|
11년 전 | 627 | |
| 7353 |
잘살아보자
|
11년 전 | 2407 | |
| 7352 |
잘살아보자
|
11년 전 | 2395 | |
| 7351 |
잘살아보자
|
11년 전 | 2466 | |
| 7350 |
잘살아보자
|
11년 전 | 1449 | |
| 7349 |
잘살아보자
|
11년 전 | 1939 | |
| 7348 |
잘살아보자
|
11년 전 | 1264 | |
| 7347 |
잘살아보자
|
11년 전 | 1067 | |
| 7346 |
멋진남자임
|
11년 전 | 1634 | |
| 7345 | 11년 전 | 967 | ||
| 7344 | 11년 전 | 3847 | ||
| 7343 | 11년 전 | 3619 | ||
| 7342 | 11년 전 | 1244 | ||
| 7341 | 11년 전 | 2498 | ||
| 7340 |
|
11년 전 | 916 | |
| 7339 | 11년 전 | 1720 | ||
| 7338 | 11년 전 | 3330 | ||
| 7337 | 11년 전 | 3624 | ||
| 7336 | 11년 전 | 4556 | ||
| 7335 | 11년 전 | 953 | ||
| 7334 | 11년 전 | 1513 | ||
| 7333 | 11년 전 | 2916 | ||
| 7332 |
|
11년 전 | 1091 | |
| 7331 |
KeePin뽁이
|
11년 전 | 1083 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기