TR 의 display 조절

HTML/CSS 2009. 4. 18. 21:16



tr의 display를 조절할 경우, 일반적으로 아래와 같이 함.

 

<tr id='tr_id'>
  <td>xxx</td>
</tr>
...
...

 

function 안보이기()
{
  document.getElementById('tr_id').style.display = 'none';
}

function 보이기()
{
  document.getElementById('tr_id').style.display = 'block';
}

 

 

 

근데 이게 IE에서는 되는데 FF에서는 안된다.

FF에는 block 이 없기 때문이다.

FF에서는 display='table-row'로 해야하지만 이건 또 IE가 못 알아먹는다.

 

[해결방법]

display = '';

이렇게 빈칸으로 주면 지가 알아서 지 display를 찾아간다...


Posted by bloodguy
,