Clickable Photo Page 1.4 says code is correct, but it doesn't look right


#1


https://www.codecademy.com/en/courses/web-beginner-en-zrZ6c/0/4?curriculum_id=50579fb998b470000202dc8b


I submitted this code and it gave me the "Way to go!" message. But the table doesn't look right. It looks like this:

<!DOCTYPE html>
<html>
	<head>
		<link type="text/css" rel="stylesheet" href="stylesheet.css" />
		<title>My Photo Page</title>
	</head>
	<body>
        <table>
	        <tbody>
	            <th>
	                <thead colspan="3">Header</thead>
	            </th>
	            <tr>Row 1</tr>
	                <td>Cell 1</td>
	                <td>Cell 2</td>
	                <td>Cell 3</td>
	            <tr>Row 2</tr>
	                <td>Cell 4</td>
	                <td>Cell 5</td>
	                <td>Cell 6</td>
	            <tr>Row 3</tr>
	                <td>Cell 7</td>
	                <td>Cell 8</td>
	                <td>Cell 9</td>
	        </tbody>
	    </table>
	</body>
</html>


#2

<th></th> is child element of <thead></thead>, not the other way around.

<thead>
    <th colspan="3">Header</th>
</thead>

But it still needs a table row element.

<thead>
  <tr>
    <th colspan="3">Header</th>
  </tr>
  <tr>
    <th>Col 1</th>
    <th>Col 2</th>
    <th>Col 3</th>
  </tr>
</thead>

There is a companion element to <thead></thead>, and that is, <tbody></tbody>, as well as <tfoot></tfoot> which we can ignore for now.

<td> elements are very much like <th></th> in that they are both cells. Consider the following...

<tbody>
  <tr>
    <td>Cell 1</td>
    <td>Cell 2</td>
    <td>Cell 3</td>
  </tr>
</tbody>

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.