2016-07-22 3 views
-2

작은 시작을 위해 웹 사이트를 만들 때 손을 잡으려고합니다. 이제는 배경색이 흰색 인 중앙 영역과 배경색이 밝은 회색을 만들고 싶습니다. 나는 배경색이 흰색이고 중앙에 정렬 된 표를 만들었지 만 페이지 하단에 나타납니다. 무슨 일 이니? 여기HTML 내용이 표에 나타나지 않습니다.

<html> 
<head> 
<title>Memocups</title> 

</head> 
<body bgcolor="#d9d9d9"> 
<table align="center" width="50%" bgcolor="#ffffff"> 
<tr> 
<p><h1>Memocups</h1><p> 
<p><h3>What is a memocup?<h3><p> 
    <img src="images/img_1_cuponstump.jpg" width="540px" height="360px"> 
<p> 
    A memocups is a coffe mug wich has a customizable picture!<br> What makes memocups unique from all other mugs with pictures is <br>that you upload the picture you want to our website and we<br> will put it on the mug! So what are you waiting for the<br>perfect gift is only a few clicks away!</p> 
</tr> 
</table> 
</body> 
</html> 
+2

, 당신은'td' [여기를 살펴] (http://www.w3schools.com/html/html_tables를 놓치고있어 .asp). 또한 표 형식의 데이터를 배치하지 않는 한 표를 사용하지 않아야합니다. – APAD1

+0

귀하의 HTML이 모든 곳에서 유효하지 않습니다. – j08691

+0

여기에서 시작하십시오 : http://validator.w3.org/nu/ – Quentin

답변

0

3 열 2 행의 간단한 표. 테이블에 대한 올바른 형식이 아닙니다

<table border=1> 
 

 
    <tr> 
 
     <td>cell 1<td> 
 
     <td>cell 2</td> 
 
     <td>cell 3</td> 
 
    </tr> 
 

 
    <tr> 
 
     <td>cell 4<td> 
 
     <td>cell 5</td> 
 
     <td>cell 6</td> 
 
    </tr> 
 

 
</table>

0

는 테이블 포맷하는 방법입니다 :

<table width="50%" style="background-color:#fff;margin:0 auto;"> 
 
\t <tr> 
 
\t \t <td> 
 
\t \t \t <h1>Memocups</h1> 
 
\t \t \t <h3>What is a memocup?</h3> 
 
\t \t \t <img src="images/img_1_cuponstump.jpg" width="540px" height="360px"> 
 
\t \t \t <p>A memocups is a coffe mug wich has a customizable picture!<br> What makes memocups unique from all other mugs with pictures is <br>that you upload the picture you want to our website and we<br> will put it on the mug! So what are you waiting for the<br>perfect gift is only a few clicks away!</p> 
 
\t \t </td> 
 
\t </tr> 
 
</table>

가 나는 그들이 필요하지 않습니다 당신이 당신의 제목 주위에 있던 p 태그를 제거했습니다. 또한 bgcoloralign은 더 이상 사용되지 않으므로 background-colormargin/float CSS를 사용해야합니다. 또한 닫지 않은 h3 태그를 수정하고 td (표 셀)을 추가했습니다.

즉, 테이블이이 데이터에 사용할 올바른 요소가 아닙니다. div를 사용해야합니다.

+0

이것은 레이아웃 테이블 (데이터 테이블과 반대)이므로,'role = "presentation"속성을 테이블 요소에 추가합니다. 배경에 대해서는 W3C 초안 [HTML에서 ARIA 사용에 대한 참고 사항] (https://www.w3.org/TR/aria-in-html/#use-of-role-presentation)을 참조하십시오. –

관련 문제