We create a three-row table in the page:
if we want to componentize, each row is a component, try writing
like this: the effect seems to be no problem, but we clicked on the structure and found that there was an error, the rendered <tr>
and <td>
tag has not been placed on tbody
the label inside, but and table
same level of:
this is because the html5 specification inside, the provisions of the following table label inside the tbody tr only place, then came alive again inside tr td, but we put the row
label:
How to deal with it:
Very simple, <tbody>
the following can only put <tr>
, we'll <row>
have changed <tr>
, but the fact is that we want to render <row>
, so we is
attribute to specify it:
Here is="row"
the meaning is that here we can not write <row>
, can write <tr>
, but we write <tr>
Actually represent <row>
. The effect is as follows:
In the same way, the following tags are also what we should pay attention to:
<ul>
or the <ol>
following must be written. <li>
<select>
The following must be written<option>