링크
http://php.chol.com/~sung21ce/kimssam/util/round.html (1873) http://php.chol.com/~sung21ce/kimssam/round.php (1650)
어디선가 낚시했다가 필요할것 같아 보관해 놓은 것인데 .
아마 모질라는 잘 모르겠습니다. ^^
링크 #1은 원본을 그대로 이용한 것이고
링크 #2는 최신글에 적용 시켜 보았습니다.
<HTML>
<HEAD>
<TITLE> 모서리 라운드테이블 </TITLE>
</HEAD>
<script>
function roundTable(objID) {
var obj = document.getElementById(objID);
var Parent, objTmp, Table, TBody, TR, TD;
var bdcolor, bgcolor, Space;
var trIDX, tdIDX, MAX;
var styleWidth, styleHeight;
// get parent node
Parent = obj.parentNode;
objTmp = document.createElement('SPAN');
Parent.insertBefore(objTmp, obj);
Parent.removeChild(obj);
// get attribute
bdcolor = obj.getAttribute('rborder');
bgcolor = obj.getAttribute('rbgcolor');
radius = parseInt(obj.getAttribute('radius'));
if (radius == null || radius < 1) radius = 1;
else if (radius > 6) radius = 6;
MAX = radius * 2 + 1;
/*
create table {{
*/
Table = document.createElement('TABLE');
TBody = document.createElement('TBODY');
Table.cellSpacing = 0;
Table.cellPadding = 0;
for (trIDX=0; trIDX < MAX; trIDX++) {
TR = document.createElement('TR');
TD = document.createElement('TD');
styleWidth = '1px'; styleHeight = '1px';
if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
else if (radius > 2) {
if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
}
if (styleWidth != null) TD.style.width = styleWidth;
if (styleHeight != null) TD.style.height = styleHeight;
if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;
if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
TR.appendChild(TD);
}
TBody.appendChild(TR);
}
/*
}}
*/
Table.appendChild(TBody);
// insert table and remove original table
Parent.insertBefore(Table, objTmp);
}
</script>
<BODY>
<table id="ta" width="300" height="150" border="0" radius="3" rborder="#999999" rbgcolor="#F8F8F8">
<tr>
<td valign="top">테스트입니다</td>
</tr>
</table>
<script>roundTable("ta");</script>
</BODY>
</HTML><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:54:41 CSS에서 이동 됨]</div>
아마 모질라는 잘 모르겠습니다. ^^
링크 #1은 원본을 그대로 이용한 것이고
링크 #2는 최신글에 적용 시켜 보았습니다.
<HTML>
<HEAD>
<TITLE> 모서리 라운드테이블 </TITLE>
</HEAD>
<script>
function roundTable(objID) {
var obj = document.getElementById(objID);
var Parent, objTmp, Table, TBody, TR, TD;
var bdcolor, bgcolor, Space;
var trIDX, tdIDX, MAX;
var styleWidth, styleHeight;
// get parent node
Parent = obj.parentNode;
objTmp = document.createElement('SPAN');
Parent.insertBefore(objTmp, obj);
Parent.removeChild(obj);
// get attribute
bdcolor = obj.getAttribute('rborder');
bgcolor = obj.getAttribute('rbgcolor');
radius = parseInt(obj.getAttribute('radius'));
if (radius == null || radius < 1) radius = 1;
else if (radius > 6) radius = 6;
MAX = radius * 2 + 1;
/*
create table {{
*/
Table = document.createElement('TABLE');
TBody = document.createElement('TBODY');
Table.cellSpacing = 0;
Table.cellPadding = 0;
for (trIDX=0; trIDX < MAX; trIDX++) {
TR = document.createElement('TR');
TD = document.createElement('TD');
styleWidth = '1px'; styleHeight = '1px';
if (tdIDX == 0 || tdIDX == MAX - 1) styleHeight = null;
else if (trIDX == 0 || trIDX == MAX - 1) styleWidth = null;
else if (radius > 2) {
if (Math.abs(tdIDX - radius) == 1) styleWidth = '2px';
if (Math.abs(trIDX - radius) == 1) styleHeight = '2px';
}
if (styleWidth != null) TD.style.width = styleWidth;
if (styleHeight != null) TD.style.height = styleHeight;
if (Space == tdIDX || Space == MAX - tdIDX - 1) TD.style.backgroundColor = bdcolor;
else if (tdIDX > Space && Space < MAX - tdIDX - 1) TD.style.backgroundColor = bgcolor;
if (Space == 0 && tdIDX == radius) TD.appendChild(obj);
TR.appendChild(TD);
}
TBody.appendChild(TR);
}
/*
}}
*/
Table.appendChild(TBody);
// insert table and remove original table
Parent.insertBefore(Table, objTmp);
}
</script>
<BODY>
<table id="ta" width="300" height="150" border="0" radius="3" rborder="#999999" rbgcolor="#F8F8F8">
<tr>
<td valign="top">테스트입니다</td>
</tr>
</table>
<script>roundTable("ta");</script>
</BODY>
</HTML><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 16:54:41 CSS에서 이동 됨]</div>
댓글 11개
20년 전
감사합니다.
불여우에서 잘됩니다.
불여우에서 잘됩니다.
태엽푸는새
19년 전
링크주소 참조
Photofly
19년 전
멋진 팁 이군요....
꼭 써보고 싶네요...감사합니다..
꼭 써보고 싶네요...감사합니다..
19년 전
감사
19년 전
라운드 테이블
홀로남은자
19년 전
blueb에서 본 스크립트네요
resfeel
19년 전
모질라도 잘 되는군요
19년 전
너무 감사합니다^-^
19년 전
이 소스는
Space = Math.abs(trIDX - parseInt(radius));
for (tdIDX=0; tdIDX < MAX; tdIDX++) {
이게 빠져서 에러납니다.
링크 참조하세요.
Space = Math.abs(trIDX - parseInt(radius));
for (tdIDX=0; tdIDX < MAX; tdIDX++) {
이게 빠져서 에러납니다.
링크 참조하세요.
18년 전
감사합니다!!
17년 전
링크가 열리지 않습니다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 830 |
|
19년 전 | 2199 | |
| 829 |
|
19년 전 | 1941 | |
| 828 |
|
19년 전 | 1823 | |
| 827 |
|
19년 전 | 1660 | |
| 826 |
|
19년 전 | 1858 | |
| 825 |
|
19년 전 | 1908 | |
| 824 |
|
19년 전 | 1963 | |
| 823 |
|
19년 전 | 2699 | |
| 822 |
|
19년 전 | 5336 | |
| 821 |
|
19년 전 | 1732 | |
| 820 |
|
19년 전 | 1588 | |
| 819 |
|
19년 전 | 1453 | |
| 818 |
|
19년 전 | 1613 | |
| 817 |
|
19년 전 | 1538 | |
| 816 |
|
19년 전 | 1461 | |
| 815 |
|
19년 전 | 1471 | |
| 814 |
|
19년 전 | 1389 | |
| 813 |
|
19년 전 | 1459 | |
| 812 | 19년 전 | 2832 | ||
| 811 |
pearly
|
19년 전 | 3848 | |
| 810 |
pearly
|
19년 전 | 5228 | |
| 809 |
|
19년 전 | 1389 | |
| 808 |
pearly
|
19년 전 | 4547 | |
| 807 | 19년 전 | 2988 | ||
| 806 |
|
19년 전 | 1509 | |
| 805 |
|
19년 전 | 2700 | |
| 804 |
|
19년 전 | 3631 | |
| 803 |
|
19년 전 | 1819 | |
| 802 |
|
19년 전 | 3798 | |
| 801 |
|
19년 전 | 1893 | |
| 800 | 19년 전 | 3779 | ||
| 799 | 19년 전 | 3448 | ||
| 798 | 19년 전 | 4215 | ||
| 797 | 19년 전 | 4086 | ||
| 796 |
|
19년 전 | 1902 | |
| 795 |
|
19년 전 | 1865 | |
| 794 | 19년 전 | 4284 | ||
| 793 | 19년 전 | 2679 | ||
| 792 | 19년 전 | 2555 | ||
| 791 | 19년 전 | 2413 | ||
| 790 | 19년 전 | 1992 | ||
| 789 | 19년 전 | 2600 | ||
| 788 | 19년 전 | 2217 | ||
| 787 | 19년 전 | 1860 | ||
| 786 | 19년 전 | 1981 | ||
| 785 | 19년 전 | 1454 | ||
| 784 |
|
19년 전 | 1702 | |
| 783 | 19년 전 | 2850 | ||
| 782 |
|
19년 전 | 1973 | |
| 781 | 19년 전 | 3261 | ||
| 780 | 19년 전 | 3172 | ||
| 779 |
|
19년 전 | 2256 | |
| 778 |
|
19년 전 | 1809 | |
| 777 | 19년 전 | 2852 | ||
| 776 | 19년 전 | 2917 | ||
| 775 | 19년 전 | 4033 | ||
| 774 |
|
19년 전 | 2000 | |
| 773 | 19년 전 | 2634 | ||
| 772 | 19년 전 | 2351 | ||
| 771 | 19년 전 | 3481 | ||
| 770 |
|
19년 전 | 1450 | |
| 769 | 19년 전 | 1513 | ||
| 768 | 19년 전 | 1788 | ||
| 767 | 19년 전 | 2211 | ||
| 766 | 19년 전 | 1841 | ||
| 765 | 19년 전 | 1702 | ||
| 764 |
|
19년 전 | 2124 | |
| 763 |
|
19년 전 | 2236 | |
| 762 |
|
19년 전 | 4970 | |
| 761 | 19년 전 | 2340 | ||
| 760 |
|
19년 전 | 3202 | |
| 759 | 19년 전 | 2653 | ||
| 758 |
|
19년 전 | 2414 | |
| 757 | 19년 전 | 4711 | ||
| 756 | 19년 전 | 2581 | ||
| 755 |
|
19년 전 | 2424 | |
| 754 |
|
19년 전 | 1975 | |
| 753 |
|
19년 전 | 1759 | |
| 752 |
pearly
|
19년 전 | 3379 | |
| 751 | 19년 전 | 2358 | ||
| 750 |
|
19년 전 | 6173 | |
| 749 | 19년 전 | 2047 | ||
| 748 |
|
19년 전 | 1919 | |
| 747 |
|
19년 전 | 2716 | |
| 746 |
|
19년 전 | 1827 | |
| 745 | 19년 전 | 2289 | ||
| 744 | 19년 전 | 2126 | ||
| 743 |
|
19년 전 | 3580 | |
| 742 | 19년 전 | 2594 | ||
| 741 | 19년 전 | 2756 | ||
| 740 |
|
19년 전 | 4379 | |
| 739 | 19년 전 | 3560 | ||
| 738 |
|
19년 전 | 2315 | |
| 737 | 19년 전 | 4325 | ||
| 736 | 19년 전 | 3285 | ||
| 735 |
홀로남은자
|
19년 전 | 4162 | |
| 734 |
홀로남은자
|
19년 전 | 2034 | |
| 733 |
홀로남은자
|
19년 전 | 2240 | |
| 732 | 19년 전 | 2149 | ||
| 731 | 19년 전 | 3374 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기