{"record":{"id":"0a5067317b2ba209","repo":"typst/typst","slug":"cannot-use-table-cell-as-a-grid-cell","errorCode":null,"errorMessage":"cannot use `table.cell` as a grid cell","messagePattern":"cannot use `table\\.cell` as a grid cell","errorType":"validation","errorClass":"HintedString","httpStatus":null,"severity":"error","filePath":"crates/typst-library/src/layout/grid/mod.rs","lineNumber":544,"sourceCode":"}\n\nimpl TryFrom<Content> for GridItem {\n    type Error = HintedString;\n    fn try_from(value: Content) -> HintedStrResult<Self> {\n        if value.is::<GridHeader>() {\n            bail!(\"cannot place a grid header within another header or footer\");\n        }\n        if value.is::<TableHeader>() {\n            bail!(\"cannot place a table header within another header or footer\");\n        }\n        if value.is::<GridFooter>() {\n            bail!(\"cannot place a grid footer within another footer or header\");\n        }\n        if value.is::<TableFooter>() {\n            bail!(\"cannot place a table footer within another footer or header\");\n        }\n        if value.is::<TableCell>() {\n            bail!(\n                \"cannot use `table.cell` as a grid cell\";\n                hint: \"use `grid.cell` instead\";\n            );\n        }\n        if value.is::<TableHLine>() {\n            bail!(\n                \"cannot use `table.hline` as a grid line\";\n                hint: \"use `grid.hline` instead\";\n            );\n        }\n        if value.is::<TableVLine>() {\n            bail!(\n                \"cannot use `table.vline` as a grid line\";\n                hint: \"use `grid.vline` instead\";\n            );\n        }\n\n        Ok(value","sourceCodeStart":526,"sourceCodeEnd":562,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-library/src/layout/grid/mod.rs#L526-L562","documentation":"Raised while converting content into a GridItem: a `table.cell` was used as a grid cell. Table cells carry table-specific styling resolution and are rejected in grids.","triggerScenarios":"Thrown at crates/typst-library/src/layout/grid/mod.rs:544 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace `table.cell(...)` with `grid.cell(...)`","Pass plain content directly as a grid child"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}