table , tr, td 전체를 링크거는 태그

미랑 · 2004-09-26 15:42:47
1. table , tr , td 에 링크거는 태그입니다.

* 테이블에 링크걸 경우

<table onMouseOver=this.style.backgroundColor='#f6f6f6' onMouseOut=this.style.backgroundColor='#ffffff' style=cursor:hand; onclick=location.href="http://cafe.naver.com/oksos">테이블내용</table>

* td 에 링크걸 경우

<td onMouseOver=this.style.backgroundColor='#f6f6f6' onMouseOut=this.style.backgroundColor='#ffffff' style=cursor:hand; onclick=location.href="http://cafe.naver.com/oksos">내용</td>

위에서 링크주소만 바꿔주시면 됩니다.

* 주석

* onMouseOver=this.style.backgroundColor='#f6f6f6' -> 마우스 오버시 배경색
* onMouseOut=this.style.backgroundColor='#ffffff' -> 마우스 아웃시 배경색
* style=cursor:hand; -> 마우스 오버시 커서를 손가락으로
* onclick=location.href="http://cafe.naver.com/oksos" -> 클릭시 이동 링크 주소

2. 만약 타겟을 주어야 할 경우가 있습니다.
테이블이나 td 에 타겟을 주어 링크를 할 경우의 태그입니다.

* 테이블에 타겟을 준 링크를 걸 경우

<table onMouseOver=this.style.backgroundColor='#f6f6f6' onMouseOut=this.style.backgroundColor='#ffffff' style=cursor:hand;
onclick=parent.타겟.location="http://cafe.naver.com/oksos">테이블내용</table>

* td 에 타겟을 준 링크를 걸 경우

<td onMouseOver=this.style.backgroundColor='#f6f6f6' onMouseOut=this.style.backgroundColor='#ffffff' style=cursor:hand;
onclick=parent.타겟.location="http://cafe.naver.com/oksos">내용</td>


위에서 타겟과 링크주소만 바꿔주시면 되는데,
타겟이 될 문서는 미리 프레임문서에서 name 값으로 정해진 값이 타겟이됩니다.

예를 들어서

<frameset >
<frame src="top.html" name="ttt">
<frame src="main.html" name="ppp">
<frame src="bottom.html" name="qqq">
</frameset>

프레임문서가 위와 같이 짜여져 있다면 타겟은 ttt 또는 ppp 또는 qqq 중 링크를 보여주실 문서의 위치를 정하시면 됩니다.