{
  "id": 13062837,
  "title": "Building a Dependency-Free Table Size Calculator for a Shopify Collection Page",
  "url": "https://urgent.news/2026/10/09/building-a-dependency-free-table-size-calculator-for-a-shopify",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-09T07:49:36.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/avni_arora_7a6959c91fd168/building-a-dependency-free-table-size-calculator-for-a-shopify-collection-page-1dhb"
  },
  "original_language": "en",
  "account": "A home decor brand, Ramaya, sought to address customer inquiries about table sizes for table runner and placemat sets. The product was the focus of most questions, but the real concern lay in fit. To help shoppers, a small calculator was developed to answer questions about size. The calculator, built on Shopify's platform, had no libraries or app installations; it consisted of a single Liquid section and around 40 lines of JavaScript code.\n\nThe calculator's rules were based on standard table linen conventions. A runner's length should be the table's length plus 12 to 24 inches, providing a six to twelve-inch drop at each end. The runner's width was roughly one-third of the table width, between 12 and 16 inches. Placemats were standardized at 12 × 18 inches, with the 12-inch side adjacent to the table edge. Each seat required about 24 inches of edge space.\n\nThe calculator's core function, `recommendTableSet`, calculated the optimal runner length, width, and number of seats based on table size. It determined the minimum and maximum runner lengths, the runner's width, the gap between two placemats, and the overlap per side. The function also calculated the number of seats along the table's long sides and the end seats for wider tables.\n\nThree common table sizes were tested against the calculator: a 30-inch by 48-inch table, a 36-inch by 60-inch table, and a 40-inch by 72-inch table. The results showed that a 12-inch runner on the 30-inch table would overlap each placemat by 3 inches, which was not a defect but a layered look customers wanted to know about. The 36-inch by 60-inch table would have six seats, while the 40-inch by 72-inch table had eight seats. The calculator was integrated into the collection page using Liquid markup and JavaScript, requiring no code changes per page. The merchant could add the section to the collection template from the theme editor using the presets block.",
  "summary": "Most product filters answer \"what do you sell?\" Very few answer \"will this fit?\" I work on the Shopify store for Ramaya, a home decor brand. One of the collections is table runner and placemat sets : one runner plus six matching placemats. Customer questions on that page were almost never about colour or fabric. They were about size. \"Will a 72 inch runner fit my table?\" \"Will the runner cover…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}