Height 100% not working in the html
평소 asp에서 <!DOCTYPE html> 선언을 잘 하지 않고 사용했다..
보통 아래처럼 그냥 사용..
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
</head>
<script language="javascript">
</script>
<body>
</body>
그렇지만 개발을 하다가 어떤 에러가 발생하여 해결책이
<!DOCTYPE html> 을 추가 시켜주는 거였는데..
?
막상 추가시키고 나니
Table height = "100%" 가 안됨...
또한 자주 사용햇던 document.body.clientWidth....도 안됨..
인터넷을 찾아보니 ...
<style type="text/css">
html, body {
height: 100vh;
background: white;
margin:0;
padding:0;
}
?
</style>
스타일을 추가 시켜주라고 하여 추가시켜주었지만.......
방법이 잘못됬는지 안됨...
몇 시간을 해매고...
결국 찾은 해결책은...
document.documentElement.clientHeight;
?
이거였음..
?
?<table id="menu" width="11" border="0" cellpadding="0" cellspacing="0"
?<tr>
<td>
?</td>
</tr>?
?</table>
?
?<script>
document.getElementById("menu").height = document.documentElement.clientHeight;
</script>