tags:

views:

89

answers:

7

Probably this is a stupid thing, but I don't see it. What is the problem?

    <html>
<body>
<form action="search" method="get">
    <input>
    <input name="action" value="search" type="submit">
</form>

<table border="1">
    <thead>
    <th>
        <td>Name</td>

    </th>
    </thead>
    <tbody>

    <tr>
        <td>Smith        </td>

    </tr>

    <tr>
        <td>Smith2        </td>
        </tr>

    </tbody>
</table>
</body>
</html>

The "Smiths" are not displayed under the "Name" cell.

+1  A: 

Th's are the root of your problem. Placing them like so will give you one column like your'e expecting.

<tr>
    <th>Name</th>
</tr>
canadiancreed
+6  A: 

th tags are "table headers", you need to place them inside tr's, "table rows".

<tr>
    <th>Name</th>
</tr>

or

<tr>
    <td>Name</td>
</tr>
yoda
+1  A: 

You don't need the < td >< /td > inside the < th > and wrap it in a < tr >, you need:

<tr>
    <th>
        Name
    </th>
</tr>
Steven Robbins
+1  A: 

Do this:

<thead>

<tr>
<th>
 Name
</th>
</tr>

</thead>

TH is just like any column () but with different default properties (bold text, center aligned text). So it has to be nested within a row ( )

Baddie
+1  A: 
Traveling Tech Guy
+2  A: 
<th>
  <td>Name</td>
</th>

Replace with:

<tr>
  <th>Name</th>
</tr>
Alexey Busygin
+2  A: 

Here are great and fresh post about table explain everything http://woork.blogspot.com/2009/09/rediscovering-html-tables.html must see :)

Rin