JoeJ JoeJ - 3 years ago 102
HTML Question

Using <dfn> in a <table>?

Is the use of

<dfn>
in a
<table>
semantically valid if the definition of the wrapped term is in the subsequent
<td>
? Is this the correct use of
<dfn>
or must it specifically be used in a paragraph or definition list, as stated on MDN. I would like to format my list like this:

Using dfn in a table

My logic says it should be allowed with the following code:

<table>
<tr>
<td><dfn>Attack</dfn></td>
<td>Time (in ms) before the compressor will begin to work after the audio level goes beyond the threshold.</td>
</tr>
<tr>
<td><dfn>Release</dfn></td>
<td>Time (in ms) before the compressor will cease to work after the audio level drops beneath the threshold.</td>
</tr>
<tr>
<td><dfn>Ratio</dfn></td>
<td>The amount of compression to be applied.</td>
</tr>
<tr>
<td><dfn>Threshold</dfn></td>
<td>A level in dB which, if the signal surpasses, the compressor will begin working.</td>
</tr>
</table>

Answer Source

Did you look at the spec?

The dfn element represents the defining instance of a term. The paragraph, description list group, or section that is the nearest ancestor of the dfn element must also contain the definition(s) for the term given by the dfn element.

Your code fragment does not contain any of the three valid ancestor, so on its own is invalid. However, I believe the <body> is classed as a section, which might make your usage allowable.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download