Specification tables
Every reference page on MDN should provide information about the specification or specifications in which that API or technology was defined. This article demonstrates what these tables look like and explains how to add them.
These tables are similar to the compatibility tables and usually both are part of a reference page.
Standard specification tables
The standard specification section looks like this:
<h2 id="Specifications">Specifications</h2>
{{Specifications}}
The {{Specifications}}
macro does all the work and generates a table containing the relevant and most current specifications.
It checks the page's front matter for the browser-compat
property to determine for which feature to load specifications.
If the page has a front-matter, like browser-compat: css.property.text-align
,
then the macro get the specifications for text-align
and renders them in a table:
Specifications
Specification |
---|
CSS Logical Properties and Values Level 1 # text-align |
CSS Text Module Level 3 # text-align-property |
Specification tables without front-matter
In case you want to display a specification section on a page that doesn't provide a front-matter,
you can pass the browser-compat query directly to the macro: {{Specifications("css.properties.text-align")}}
Non-standard features
When documenting a feature that doesn't have a specification (anymore),
don't call the {{Specifications}}
macro.
Instead, try to provide information about the standardization status and possible alternatives. Examples:
- This method is no longer on a standardization track. It is kept for compatibility purposes. Use the this other method instead.
- This method was originally a part of DOM Level 2 Traversal and Range, but is absent in the current DOM specification. This feature is no longer on track to become a standard.
- This event handler was part of the old WebVR API that has been superseded by the WebXR Device API. It is no longer on track to becoming a standard.