PageSourceSearch

https://markuplint.dev/assets/js/90acc1dc.54838d5a.js

js markuplint.dev collected 2026-10-03 22:01:48 UTC 5,358 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmarkuplint_website=self.webpackChunkmarkuplint_website||[]).push([[8843],{8365(e,t,n){n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>o,default:()=>h,frontMatter:()=>a,metadata:()=>r,toc:()=>c});const r=JSON.parse('{"id":"rules/consistent-table-row-length","title":"consistent-table-row-length","description":"Warns when a row\'s number of columns disagrees with the rest of the table.","source":"@site/docs/rules/consistent-table-row-length.md","sourceDirName":"rules","slug":"/rules/consistent-table-row-length","permalink":"/docs/rules/consistent-table-row-length","draft":false,"unlisted":false,"editUrl":"https://github.com/markuplint/markuplint/edit/main/packages/@markuplint/rules/src/consistent-table-row-length/README.md","tags":[],"version":"current","frontMatter":{"id":"consistent-table-row-length","description":"Warns when a row\'s number of columns disagrees with the rest of the table.","custom_edit_url":"https://github.com/markuplint/markuplint/edit/main/packages/@markuplint/rules/src/consistent-table-row-length/README.md"},"sidebar":"rules","previous":{"title":"class-naming","permalink":"/docs/rules/class-naming"},"next":{"title":"element-supports-aria-prop","permalink":"/docs/rules/element-supports-aria-prop"}}');var s=n(4848),l=n(8453);const a={id:"consistent-table-row-length",description:"Warns when a row's number of columns disagrees with the rest of the table.",custom_edit_url:"https://github.com/markuplint/markuplint/edit/main/packages/@markuplint/rules/src/consistent-table-row-length/README.md"},o="consistent-table-row-length",i={},c=[{value:"Interface",id:"interface",level:2},{value:"Default Severity",id:"default-severity",level:2}];function d(e){const t={a:"a",code:"code",em:"em",h1:"h1",h2:"h2",header:"header",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"consistent-table-row-length",children:(0,s.jsx)(t.code,{children:"consistent-table-row-length"})})}),"\n",(0,s.jsxs)(t.p,{children:["Warns when a ",(0,s.jsx)(t.code,{children:"<table>"})," row's number of columns is inconsistent with the table's base column count \u2014 fewer (a missing column) or more (an extra column), accounting for ",(0,s.jsx)(t.code,{children:"colspan"})," / ",(0,s.jsx)(t.code,{children:"rowspan"}),"."]}),"\n",(0,s.jsxs)(t.p,{children:["Unlike its sibling splits of the former ",(0,s.jsx)(t.code,{children:"table-row-column-alignment"})," rule \u2014 ",(0,s.jsx)(t.a,{href:"/docs/rules/no-table-cell-overlap",children:(0,s.jsx)(t.code,{children:"no-table-cell-overlap"})}),", ",(0,s.jsx)(t.a,{href:"/docs/rules/no-table-span-overflow",children:(0,s.jsx)(t.code,{children:"no-table-span-overflow"})}),", and ",(0,s.jsx)(t.a,{href:"/docs/rules/no-empty-table-track",children:(0,s.jsx)(t.code,{children:"no-empty-table-track"})})," \u2014 this is not a table model error: ",(0,s.jsxs)(t.a,{href:"https://html.spec.whatwg.org/multipage/tables.html#forming-a-table",children:["HTML Living Standard \xa74.9.12.1 ",(0,s.jsx)(t.em,{children:"Forming a table"}),", Step 7"]})," grows the table to fit a wider row, and a narrower row is only a table model error where ",(0,s.jsx)(t.code,{children:"no-empty-table-track"})," already catches it (a column no cell ever anchors to). A ragged table is nevertheless almost always a mistake, which is why this check exists and why its default severity stays ",(0,s.jsx)(t.code,{children:"warning"})," rather than the ",(0,s.jsx)(t.code,{children:"error"})," of its siblings. It reports nothing on a table ",(0,s.jsx)(t.code,{children:"no-table-cell-overlap"})," already reports on, since row widths derived from an overlapping table are no longer reliable."]}),"\n",(0,s.jsxs)(t.p,{children:["\u274c Examples of ",(0,s.jsx)(t.strong,{children:"incorrect"})," code for this rule"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-html",children:'<table>\n  <tr>\n    <th></th>\n  </tr>\n  <tr>\n    <td></td>\n    <td class="extra"></td>\n  </tr>\n</table>\n\n<table>\n  <tr>\n    <th></th>\n    <th></th>\n    <th></th>\n  </tr>\n  <tr>\n    <td></td>\n    <td></td>\n  </tr>\n</table>\n'})}),"\n",(0,s.jsxs)(t.p,{children:["\u2705 Examples of ",(0,s.jsx)(t.strong,{children:"correct"})," code for this rule"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-html",children:"<table>\n  <tr>\n    <th></th>\n  </tr>\n  <tr>\n    <td></td>\n  </tr>\n</table>\n"})}),"\n",(0,s.jsx)(t.h2,{id:"interface",children:"Interface"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ts",children:'{\n  "consistent-table-row-length": boolean\n}\n'})}),"\n",(0,s.jsx)(t.h2,{id:"default-severity",children:"Default Severity"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.code,{children:"warning"})})]})}function h(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453(e,t,n){n.d(t,{R:()=>a,x:()=>o});var r=n(6540);const s={},l=r.createContext(s);function a(e){const t=r.useContext(l);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function o(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:a(e.components),r.createElement(l.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.