# Start tag “p” seen in “table”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/start-tag-p-seen-in-table
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A `<p>` can't sit directly inside a `<table>`, `<thead>`, `<tbody>`, `<tfoot>` or `<tr>`: put the paragraph inside a `<td>` or `<th>` cell, or move it outside the table.

Table elements only accept specific children. A `<table>` holds `<caption>`, `<colgroup>`, `<thead>`, `<tbody>`, `<tfoot>` and `<tr>`, and a `<tr>` holds `<td>` and `<th>`. A paragraph is allowed inside a cell or a `<caption>`, but not between rows.

When the browser's parser finds a misplaced `<p>`, it moves the paragraph out and inserts it just before the table. The HTML specification calls this foster parenting. A paragraph you wrote as a table title or a note between rows shows up above the table instead, and an empty `<p></p>` left between rows becomes an empty paragraph above it.

The validator stops checking the page at this error and adds `Cannot recover after last error. Any further errors will be ignored.` right after it. Nothing below that point gets checked, so new issues further down the page can show up once you fix this one.

To fix it, put a table title in a `<caption>`, move text that belongs to a row into a `<td>` or `<th>`, and delete empty `<p></p>` pairs between rows. If those empty paragraphs were there to add space between rows, use CSS `padding` on the cells or `border-spacing` on the table instead.

## Invalid example

```html
<table>
  <p>Opening hours</p>
  <tr>
    <td>Monday</td>
    <td>9:00 to 17:00</td>
  </tr>
  <p></p>
  <tr>
    <td>Saturday</td>
    <td>Closed</td>
  </tr>
</table>
```

## Valid example

```html
<table>
  <caption>Opening hours</caption>
  <tr>
    <td>Monday</td>
    <td>9:00 to 17:00</td>
  </tr>
  <tr>
    <td>Saturday</td>
    <td>Closed</td>
  </tr>
</table>
```
