HTML Table Cell Span Occupancy Map

Build an occurrence-preserving HTML cell-span owner map at explicitly supplied source coordinates for one row group; rowspan zero reaches that group’s end, no automatic browser table placement.

Description

Build an occurrence-preserving HTML cell-span owner map at explicitly supplied source coordinates for one row group; rowspan zero reaches that group’s end, no automatic browser table placement.

A spanning table cell can own several grid positions. This map exposes overlaps among explicitly positioned cells within one supplied row group.

When to use this tool

Build an occurrence-preserving HTML cell-span owner map at explicitly supplied source coordinates for one row group; rowspan zero reaches that group’s end, no automatic browser table placement.

  • Prepare the supplied cellsJson, rows, columns fields for this operation.
  • Compare the complete example with the representation used by your own input before carrying the result into another step.

How to use the tool and how it works

  1. Enter cellsJson, rows, columns. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.occupancy, result.overlaps. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Parse cellsJson as objects with row, column, rowspan and colspan. rows and columns range from 0 to 128; coordinates are zero-based, rowspan from 0 to 65,534 and colspan from 1 to 1,000. A zero rowspan reaches the group's final row. Append each source-cell index to every covered position and report positions with multiple owners; reject spans outside the grid.1

Input fieldMeaning and representationAccepted input
cellsJsonJSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file.Text
rowsrows.Integer from 0 to 128 inclusive
columnscolumns.Integer from 0 to 128 inclusive

For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.

json
[
  {
    "field": "cellsJson",
    "decoded": [
      {
        "row": 0,
        "column": 0,
        "rowspan": 0,
        "colspan": 1
      },
      {
        "row": 1,
        "column": 0,
        "rowspan": 1,
        "colspan": 2
      }
    ]
  }
]
Output fieldInterpretation
resultObject containing the named outputs below.
result.occupancyThe occupancy list in the ordering and representation described above.
result.overlapsThe overlaps list in the ordering and representation described above.
json
{
  "input": {
    "cellsJson": "[{\"row\":0,\"column\":0,\"rowspan\":0,\"colspan\":1},{\"row\":1,\"column\":0,\"rowspan\":1,\"colspan\":2}]",
    "rows": 2,
    "columns": 2
  },
  "output": {
    "result": {
      "occupancy": [
        [
          [
            0
          ],
          []
        ],
        [
          [
            0,
            1
          ],
          [
            1
          ]
        ]
      ],
      "overlaps": [
        {
          "row": 1,
          "column": 0,
          "owners": [
            0,
            1
          ]
        }
      ]
    }
  }
}

Limitations and assumptions

  • No HTML is parsed and no browser placement algorithm is run. Coordinates and row-group boundaries must already be established; an empty owner list denotes an uncovered position.
  • All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
  • JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.

Alternative or Complementary methods

For actual document behavior, inspect a parsed DOM and the relevant HTML algorithm. These tools transform supplied tokens, observations or coordinates; compare the browser result when parsing or layout matters.

References

  1. Tool behavior and example: HTML Table Cell Span Occupancy Map — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies