Tags: table
Aliases: table-pipe-style
Parameters: style ("consistent", "leading_and_trailing", "leading_only", "trailing_only", or "no_leading_or_trailing"; default "consistent")
This rule is triggered for tables that don't have a consistent style for their leading and trailing pipe characters.
Some parsers have difficulty with tables that are missing their leading or trailing pipe characters. The use of leading/trailing pipes can also help provide visual clarity.
The following table is missing its trailing pipe characters:
| Header | Header |
| ------ | ------
Cell | Cell |The following table is missing its leading pipe characters:
Header | Header |
------ | ------ |
Cell | Cell |Both of the above cases can be fixed by adding the missing pipe characters:
| Header | Header |
| ------ | ------ |
| Cell | Cell |The style parameter can be used to specify which pipe style to expect:
consistent- Tables must have the same style as the first tableleading_and_trailing- Tables must have pipes at the beginning and end of every rowleading_only- Tables must have pipes at the beginning of every rowtrailing_only- Tables must have pipes at the end of every rowno_leading_or_trailing- Tables must not have pipes at the beginning or end of rows
This rule supports automatic fixing of violations.