링크
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년 전 | 2182 | |
| 829 |
|
19년 전 | 1915 | |
| 828 |
|
19년 전 | 1807 | |
| 827 |
|
19년 전 | 1654 | |
| 826 |
|
19년 전 | 1847 | |
| 825 |
|
19년 전 | 1886 | |
| 824 |
|
19년 전 | 1943 | |
| 823 |
|
19년 전 | 2687 | |
| 822 |
|
19년 전 | 5316 | |
| 821 |
|
19년 전 | 1721 | |
| 820 |
|
19년 전 | 1573 | |
| 819 |
|
19년 전 | 1435 | |
| 818 |
|
19년 전 | 1596 | |
| 817 |
|
19년 전 | 1520 | |
| 816 |
|
19년 전 | 1443 | |
| 815 |
|
19년 전 | 1457 | |
| 814 |
|
19년 전 | 1378 | |
| 813 |
|
19년 전 | 1441 | |
| 812 | 19년 전 | 2815 | ||
| 811 |
pearly
|
19년 전 | 3833 | |
| 810 |
pearly
|
19년 전 | 5208 | |
| 809 |
|
19년 전 | 1374 | |
| 808 |
pearly
|
19년 전 | 4539 | |
| 807 | 19년 전 | 2978 | ||
| 806 |
|
19년 전 | 1498 | |
| 805 |
|
19년 전 | 2690 | |
| 804 |
|
19년 전 | 3616 | |
| 803 |
|
19년 전 | 1798 | |
| 802 |
|
19년 전 | 3789 | |
| 801 |
|
19년 전 | 1881 | |
| 800 | 19년 전 | 3770 | ||
| 799 | 19년 전 | 3431 | ||
| 798 | 19년 전 | 4204 | ||
| 797 | 19년 전 | 4057 | ||
| 796 |
|
19년 전 | 1893 | |
| 795 |
|
19년 전 | 1848 | |
| 794 | 19년 전 | 4274 | ||
| 793 | 19년 전 | 2667 | ||
| 792 | 19년 전 | 2544 | ||
| 791 | 19년 전 | 2394 | ||
| 790 | 19년 전 | 1970 | ||
| 789 | 19년 전 | 2588 | ||
| 788 | 19년 전 | 2204 | ||
| 787 | 19년 전 | 1845 | ||
| 786 | 19년 전 | 1971 | ||
| 785 | 19년 전 | 1441 | ||
| 784 |
|
19년 전 | 1693 | |
| 783 | 19년 전 | 2835 | ||
| 782 |
|
19년 전 | 1955 | |
| 781 | 19년 전 | 3246 | ||
| 780 | 19년 전 | 3154 | ||
| 779 |
|
19년 전 | 2242 | |
| 778 |
|
19년 전 | 1794 | |
| 777 | 19년 전 | 2835 | ||
| 776 | 19년 전 | 2899 | ||
| 775 | 19년 전 | 4016 | ||
| 774 |
|
19년 전 | 1973 | |
| 773 | 19년 전 | 2620 | ||
| 772 | 19년 전 | 2337 | ||
| 771 | 19년 전 | 3468 | ||
| 770 |
|
19년 전 | 1430 | |
| 769 | 19년 전 | 1495 | ||
| 768 | 19년 전 | 1767 | ||
| 767 | 19년 전 | 2202 | ||
| 766 | 19년 전 | 1832 | ||
| 765 | 19년 전 | 1693 | ||
| 764 |
|
19년 전 | 2105 | |
| 763 |
|
19년 전 | 2215 | |
| 762 |
|
19년 전 | 4963 | |
| 761 | 19년 전 | 2326 | ||
| 760 |
|
19년 전 | 3192 | |
| 759 | 19년 전 | 2640 | ||
| 758 |
|
19년 전 | 2405 | |
| 757 | 19년 전 | 4697 | ||
| 756 | 19년 전 | 2560 | ||
| 755 |
|
19년 전 | 2412 | |
| 754 |
|
19년 전 | 1949 | |
| 753 |
|
19년 전 | 1730 | |
| 752 |
pearly
|
19년 전 | 3367 | |
| 751 | 19년 전 | 2342 | ||
| 750 |
|
19년 전 | 6156 | |
| 749 | 19년 전 | 2024 | ||
| 748 |
|
19년 전 | 1899 | |
| 747 |
|
19년 전 | 2704 | |
| 746 |
|
19년 전 | 1812 | |
| 745 | 19년 전 | 2281 | ||
| 744 | 19년 전 | 2110 | ||
| 743 |
|
19년 전 | 3563 | |
| 742 | 19년 전 | 2578 | ||
| 741 | 19년 전 | 2744 | ||
| 740 |
|
19년 전 | 4364 | |
| 739 | 19년 전 | 3547 | ||
| 738 |
|
19년 전 | 2306 | |
| 737 | 19년 전 | 4306 | ||
| 736 | 19년 전 | 3266 | ||
| 735 |
홀로남은자
|
19년 전 | 4135 | |
| 734 |
홀로남은자
|
19년 전 | 2022 | |
| 733 |
홀로남은자
|
19년 전 | 2227 | |
| 732 | 19년 전 | 2139 | ||
| 731 | 19년 전 | 3352 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기