Uniform Card Last Row Filler

Plan uniform-grid last-row filler count, with no filler row for zero items; does not generate DOM elements.

Description

Plan uniform-grid last-row filler count, with no filler row for zero items; does not generate DOM elements.

A regular card grid may need placeholder slots to complete its final row. Empty and already complete grids have special counts.

When to use this tool

Plan uniform-grid last-row filler count, with no filler row for zero items; does not generate DOM elements.

  • Prepare the supplied itemCount, 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 itemCount, 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.fillerCount, result.lastRowItemCount. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Require nonnegative integer itemCount and positive columns. For nonempty grids, fillerCount is nonnegative modulo(-itemCount,columns) and lastRowItemCount is the remainder or columns. Empty grids return both zero.1

Input fieldMeaning and representationAccepted input
itemCountitem count.Integer from 0 to 1e9 inclusive
columnscolumns.Integer from 1 to 1e9 inclusive
Output fieldInterpretation
resultObject containing the named outputs below.
result.fillerCountThe filler count value under the stated formula or text convention.
result.lastRowItemCountThe last row item count value under the stated formula or text convention.
json
{
  "input": {
    "itemCount": 8,
    "columns": 3
  },
  "output": {
    "result": {
      "fillerCount": 1,
      "lastRowItemCount": 2
    }
  }
}

Limitations and assumptions

  • No placeholder content or actual grid layout is generated. The counts assume every item occupies one slot.
  • Rectangle arrays use [x,y,width,height] with nonnegative extents. All dimensions must use the same coordinate frame and unit; values are supplied rather than measured from a page.
  • Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
  • String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
  • Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.

Alternative or Complementary methods

Measure the actual layout when browser behavior matters. The formulas use supplied coordinates and explicit simplifications; they do not account for every box, writing mode, clipping ancestor or simultaneous layout change.

References

  1. Tool behavior and example: Uniform Card Last Row Filler — tool.io

Similar or alternative tools

  • Fixed Row Visible Index Range

    Plan half-open visible fixed-row indexes with positive geometric intersection; exact end contacts are excluded and empty viewports contain no rows.

  • Variable Row Prefix Offsets

    Compute cumulative variable-row boundary offsets, including the terminal boundary and explicit zero-height rows.

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