René's URL Explorer Experiment


Title: Feature Request: Support Fixed cellWidth with Automatic Column Calculation · Issue #3469 · gridstack/gridstack.js · GitHub

Open Graph Title: Feature Request: Support Fixed cellWidth with Automatic Column Calculation · Issue #3469 · gridstack/gridstack.js

X Title: Feature Request: Support Fixed cellWidth with Automatic Column Calculation · Issue #3469 · gridstack/gridstack.js

Description: Feature Request: Support Fixed cellWidth with Automatic Column CalculationBackgroundI'm using GridStack.js in my project to build a grid-based dashboard/layout system.Currently, the grid layout is primarily controlled by the number of co...

Open Graph Description: Feature Request: Support Fixed cellWidth with Automatic Column CalculationBackgroundI'm using GridStack.js in my project to build a grid-based dashboard/layout system.Currently, the grid layout is ...

X Description: Feature Request: Support Fixed cellWidth with Automatic Column CalculationBackgroundI'm using GridStack.js in my project to build a grid-based dashboard/layout system.Currently, the grid layout...

Opengraph URL: https://github.com/gridstack/gridstack.js/issues/3469

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature Request: Support Fixed cellWidth with Automatic Column Calculation","articleBody":"\u003chtml>\n\u003cbody>\n\u003c!--StartFragment-->\u003ch2>\u003cspan>Feature Request: Support Fixed \u003c/span>\u003ccode>\u003cspan>cellWidth\u003c/span>\u003c/code>\u003cspan> with Automatic Column Calculation\u003c/span>\u003c/h2>\u003ch3>\u003cspan>Background\u003c/span>\u003c/h3>\u003cp>\u003cspan>I'm using GridStack.js in my project to build a grid-based dashboard/layout system.\u003c/span>\u003c/p>\u003cp>\u003cspan>Currently, the grid layout is primarily controlled by the number of columns and the container width. While \u003c/span>\u003ccode>\u003cspan>column\u003c/span>\u003c/code>\u003cspan> and \u003c/span>\u003ccode>\u003cspan>columnOpts.columnWidth\u003c/span>\u003c/code>\u003cspan> provide some flexibility, I'd like to have more direct control over the cell width and let GridStack automatically determine the number of columns based on the available container width.\u003c/span>\u003c/p>\u003ch3>\u003cspan>Problem\u003c/span>\u003c/h3>\u003cp>\u003cspan>In my use case, I need the cell width to remain fixed regardless of the container width.\u003c/span>\u003c/p>\u003cp>\u003cspan>When the container is resized, I want the number of columns to automatically adjust based on the available space, rather than having the cell width change to fit the container.\u003c/span>\u003c/p>\u003cp>\u003cspan>For example:\u003c/span>\u003c/p>\u003cul>\u003cli>\u003cp>\u003cspan>If the container width is \u003c/span>\u003ccode>\u003cspan>1200px\u003c/span>\u003c/code>\u003cspan> and the cell width is \u003c/span>\u003ccode>\u003cspan>100px\u003c/span>\u003c/code>\u003cspan>, the grid should have approximately 12 columns.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>If the container width changes to \u003c/span>\u003ccode>\u003cspan>800px\u003c/span>\u003c/code>\u003cspan>, the grid should automatically adjust to approximately 8 columns.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>The cell width should remain \u003c/span>\u003ccode>\u003cspan>100px\u003c/span>\u003c/code>\u003cspan> in both cases.\u003c/span>\u003c/p>\u003c/li>\u003c/ul>\u003cp>\u003cspan>Currently, achieving this behavior requires custom logic to calculate the number of columns and update the grid accordingly.\u003c/span>\u003c/p>\u003ch3>\u003cspan>Proposed Feature\u003c/span>\u003c/h3>\u003cp>\u003cspan>Would it be possible to introduce a configurable \u003c/span>\u003ccode>\u003cspan>cellWidth\u003c/span>\u003c/code>\u003cspan> option that allows developers to specify a fixed cell width, while GridStack automatically calculates the number of columns based on the container width?\u003c/span>\u003c/p>\u003cp>\u003cspan>For example:\u003c/span>\u003c/p>\u003cpre>\u003ccode>\u003cspan>GridStack.init({\n  cellWidth: 100,\n  cellHeight: 80,\n  column: 'auto'\n});\u003c/span>\u003c/code>\u003c/pre>\u003cp>\u003cspan>In this mode:\u003c/span>\u003c/p>\u003cul>\u003cli>\u003cp>\u003ccode>\u003cspan>cellWidth\u003c/span>\u003c/code>\u003cspan> remains fixed (e.g. \u003c/span>\u003ccode>\u003cspan>100px\u003c/span>\u003c/code>\u003cspan>).\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>The number of columns is automatically calculated based on the container's available width.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>When the container is resized, the column count is recalculated automatically.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>The cell width does not shrink or expand to fill the container.\u003c/span>\u003c/p>\u003c/li>\u003c/ul>\u003cp>\u003cspan>Ideally, \u003c/span>\u003ccode>\u003cspan>cellWidth\u003c/span>\u003c/code>\u003cspan> could support pixel values and other CSS length units where appropriate.\u003c/span>\u003c/p>\u003ch3>\u003cspan>Expected Behavior\u003c/span>\u003c/h3>\u003cp>\u003cspan>Assuming \u003c/span>\u003ccode>\u003cspan>cellWidth\u003c/span>\u003c/code>\u003cspan> is set to \u003c/span>\u003ccode>\u003cspan>100px\u003c/span>\u003c/code>\u003cspan>:\u003c/span>\u003c/p>\nContainer Width | Expected Column Count | Cell Width\n-- | -- | --\n1200px | 12 | 100px\n1000px | 10 | 100px\n800px | 8 | 100px\n650px | 6 | 100px\n\n\u003cp>\u003cspan>The grid should automatically adjust the column count when the container width changes, while keeping the cell width fixed.\u003c/span>\u003c/p>\u003cp>\u003cspan>If the available width is not an exact multiple of \u003c/span>\u003ccode>\u003cspan>cellWidth\u003c/span>\u003c/code>\u003cspan>, the remaining space could be left unused, or handled according to the grid's existing alignment behavior.\u003c/span>\u003c/p>\u003ch3>\u003cspan>Use Cases\u003c/span>\u003c/h3>\u003cul>\u003cli>\u003cp>\u003cspan>Building dashboards with fixed-size grid cells.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>Maintaining consistent widget dimensions across different container sizes.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>Creating responsive layouts where the number of columns changes but the cell width remains constant.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>Avoiding custom resize handlers and manual column recalculation.\u003c/span>\u003c/p>\u003c/li>\u003cli>\u003cp>\u003cspan>Making grid layouts more predictable when embedded in different containers.\u003c/span>\u003c/p>\u003c/li>\u003c/ul>\u003ch3>\u003cspan>API Suggestion\u003c/span>\u003c/h3>\u003cp>\u003cspan>A possible API could be:\u003c/span>\u003c/p>\u003cpre>\u003ccode>\u003cspan>GridStack.init({\n  cellWidth: 100,\n  cellHeight: 80,\n  column: 'auto'\n});\u003c/span>\u003c/code>\u003c/pre>\u003cp>\u003cspan>Alternatively, this could be implemented as an extension of the existing \u003c/span>\u003ccode>\u003cspan>columnOpts\u003c/span>\u003c/code>\u003cspan> configuration if that better fits GridStack's current API design.\u003c/span>\u003c/p>\u003ch3>\u003cspan>Additional Consideration\u003c/span>\u003c/h3>\u003cp>\u003cspan>It would be great if this behavior could work with GridStack's existing features, including drag-and-drop, resizing, responsive behavior, and layout serialization, without requiring users to implement their own container resize logic.\u003c/span>\u003c/p>\u003cp>\u003cspan>I understand that this may require changes to the grid's layout calculations. I'd appreciate feedback on whether this feature could be supported and what API design would be appropriate.\u003c/span>\u003c/p>\u003cp>\u003cspan>Thanks for maintaining GridStack.js!\u003c/span>\u003c/p>\u003c!--EndFragment-->\n\u003c/body>\n\u003c/html>","author":{"url":"https://github.com/zhangtian512","@type":"Person","name":"zhangtian512"},"datePublished":"2026-11-19T08:53:04Z","url":"https://github.com/gridstack/gridstack.js/issues/3469"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:eb91bf20-775b-2d2d-9ac1-7e456a485b83
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDCD2:9771F:10EF7C:169B77:6AFF4A7D
html-safe-nonce666d836d13aeab8b6c01b5b1d0c8d265f176ad54bb122d2ee132a1141a7c06ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0QyOjk3NzFGOjEwRUY3QzoxNjlCNzc6NkFGRjRBN0QiLCJ2aXNpdG9yX2lkIjoiMjM2NDk4OTI5MzQwNDgzNDQyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac41d3a3552bd376673670dcc2315edd01b9fd4773e622888e26f3062eb75acde4
hovercard-subject-tagissue:6485918572
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gridstack/gridstack.js/3469/issue_layout
twitter:imagehttps://opengraph.githubassets.com/49614c8aa863b2f425a5af9b2e679cdef9a6d459fe594e0c3bc217109551fa6b/gridstack/gridstack.js/issues/3469
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/49614c8aa863b2f425a5af9b2e679cdef9a6d459fe594e0c3bc217109551fa6b/gridstack/gridstack.js/issues/3469
og:image:altFeature Request: Support Fixed cellWidth with Automatic Column CalculationBackgroundI'm using GridStack.js in my project to build a grid-based dashboard/layout system.Currently, the grid layout is ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezhangtian512
hostnamegithub.com
expected-hostnamegithub.com
None6672a281260b126053da5da19a6127ba7804ee26f255c9b12ad124a822a55cd0
turbo-cache-controlno-preview
go-importgithub.com/gridstack/gridstack.js git https://github.com/gridstack/gridstack.js.git
octolytics-dimension-user_id31674162
octolytics-dimension-user_logingridstack
octolytics-dimension-repository_id26417283
octolytics-dimension-repository_nwogridstack/gridstack.js
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id26417283
octolytics-dimension-repository_network_root_nwogridstack/gridstack.js
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release28805d6cf6280f5e10f2a6624504c872d9633a0f
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/gridstack/gridstack.js/issues/3469#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgridstack%2Fgridstack.js%2Fissues%2F3469
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgridstack%2Fgridstack.js%2Fissues%2F3469
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=gridstack%2Fgridstack.js
Reloadhttps://github.com/gridstack/gridstack.js/issues/3469
Reloadhttps://github.com/gridstack/gridstack.js/issues/3469
Reloadhttps://github.com/gridstack/gridstack.js/issues/3469
gridstackhttps://github.com/gridstack
gridstack.jshttps://github.com/gridstack/gridstack.js
Codehttps://github.com/gridstack/gridstack.js
Issues17 (17)https://github.com/gridstack/gridstack.js/issues
Pull requests3 (3)https://github.com/gridstack/gridstack.js/pulls
Actionshttps://github.com/gridstack/gridstack.js/actions
Projectshttps://github.com/gridstack/gridstack.js/projects
Wikihttps://github.com/gridstack/gridstack.js/wiki
Security and qualityhttps://github.com/gridstack/gridstack.js/security
Insightshttps://github.com/gridstack/gridstack.js/insights
https://github.com/gridstack/gridstack.js
New issuehttps://github.com/login?return_to=https://github.com/gridstack/gridstack.js/issues/3469
New issuehttps://github.com/login?return_to=https://github.com/gridstack/gridstack.js/issues/3469
Feature Request: Support Fixed cellWidth with Automatic Column Calculationhttps://github.com/gridstack/gridstack.js/issues/3469#top
https://github.com/zhangtian512
zhangtian512https://github.com/zhangtian512
on Nov 19, 2026https://github.com/gridstack/gridstack.js/issues/3469#issue-6485918572
Sign up for freehttps://github.com/signup?return_to=https://github.com/gridstack/gridstack.js/issues/3469
Sign in to commenthttps://github.com/login?return_to=https://github.com/gridstack/gridstack.js/issues/3469
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.