HTML 표준에 TABLE의 height 속성이 없다?

segfault의 이미지

<table width="100%" height="100%">

이렇게 해서 테이블을 화면 전체에 채우려고 하는데

HTML 표준에는 height 속성이 없군요.

어떻게 하면 표준을 지키면서 테이블을 화면 전체에 꽉 채울 수 있을까요?

Prentice의 이미지

표준을 지키시려면 CSS를 활용하세요. CSS를 쓰시면 될지도요.

랜덤여신의 이미지

<table style="width: 100%; height: 100%;"><tr><td></td></tr></table>

참고로, bgcolor 같은 속성들도 같이 표준이 아닙니다. CSS 로 background-color: 어쩌구; 로 쓰세요 :)

creativeidler의 이미지

firefox에서 th 태그에 background-color가 안 먹던데요. 혹시나 해서 IE로 보니까 IE로는 나와요. 근데 또 IE에선 table의 border-spacing이 안 먹고-_-

fender의 이미지

creativeidler wrote:
firefox에서 th 태그에 background-color가 안 먹던데요. 혹시나 해서 IE로 보니까 IE로는 나와요. 근데 또 IE에선 table의 border-spacing이 안 먹고-_-

그럴리가요? :) 혹시 스타일에 안쓰고 태그에 <th background-color="red">이렇게 하신게 아닌지요?

----------------------------
[서명] 그놈 한국 사용자 모임 - 그놈에 대한 모든 것! - 게시판, IRC, 위키, 갤러리 등등...

Prentice의 이미지

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Table Color Test</title>
		<style type="text/css">
			body { background: red }
			table { background: yellow }
			td { background: blue }
			th { background: green }
			html { background: gray }
		</style>
	</head>
<body>
	<table>
		<tr>
			<th colspan="2">Header</th>
		</tr>
		<tr>
			<td>1</td>
			<td>2</td>
		</tr>
	</table>
</body>
</html>

원하는 대로 잘 나옵니다.
creativeidler의 이미지

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

<!--
    <link rel="stylesheet" type="text/css" href="styles.css"/>
-->
<style>
table {
	border-spacing:1;
	border-style:grove;
};

th {
	background-color: #EFFEF5;
};
</style>

  </head>
  
  <body>
    <table border="1">
      <tr>
        <th>헤더</th>
	<td>내용</td>
      </tr>
    </table>
  </body>
</html>

안 나오는데요.

angpoo의 이미지

}뒤에 ;빼세요

Prentice의 이미지