react-grid-layout icon indicating copy to clipboard operation
react-grid-layout copied to clipboard

Set space between grid items (without changing size of grid items)

Open oyshan opened this issue 9 years ago • 5 comments

  • [X] Bug
  • [ ] Feature Request
  • [X] Question

Is there a way to set the space (margin) between the grid items (in pixels) without changing the size of the grid items? One should think that margin is applicable for this, but changing the margin also changes the size (width and height) of the grid items, which is unfortunate.

oyshan avatar Jun 27 '17 07:06 oyshan

Just increase the size to compensate.

On Jun 27, 2017 2:03 AM, "Øystein Wethe Hanssen" [email protected] wrote:

  • Bug
  • Feature Request
  • Question

Is there a way to set the space (margin) between the grid items (in pixels) without changing the size of the grid items? One should think that margin is applicable for this, but changing the margin also changes the size (width and height) of the grid items, which is unfortunate.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/STRML/react-grid-layout/issues/583, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJFP-X63OAq08qEVboQgUGZUSSMuHveks5sIKkzgaJpZM4OGOLf .

STRML avatar Jun 27 '17 10:06 STRML

Thanks for your reply! :) I'm sure this is a stupid question, but how do I do that?

E.g. if I change the margin from [10,10] to [0,0] or [13,13], what should be increased/decreased to avoid changing the size of the grid items?

Grid setup:

  • breakpoints = { lg: 768, sm: 0 }
  • cols = { lg: 72, sm: 1 }
  • rowHeight = {10}

A grid item's layout can be e.g.:

  • h:10
  • minH:2
  • minW:4
  • w:24
  • x:0
  • y:0

oyshan avatar Jun 27 '17 11:06 oyshan

surely, you can put x and y values such that u can generate minimum gap b/w them.... i hope this will solve ur issue but yes this will affect on container's width and height !! but still u can set your data-grid in such way that u will have desire spaces b/w ur boxes....

Subhash9325 avatar Jun 28 '17 04:06 Subhash9325

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days

github-actions[bot] avatar Oct 10 '19 12:10 github-actions[bot]

Thanks for your reply! :) I'm sure this is a stupid question, but how do I do that?

E.g. if I change the margin from [10,10] to [0,0] or [13,13], what should be increased/decreased to avoid changing the size of the grid items?

Grid setup:

  • breakpoints = { lg: 768, sm: 0 }
  • cols = { lg: 72, sm: 1 }
  • rowHeight = {10}

A grid item's layout can be e.g.:

  • h:10
  • minH:2
  • minW:4
  • w:24
  • x:0
  • y:0

Hi @oyshan Did you get any success on this issue?

  • [x] Bug
  • [ ] Feature Request
  • [x] Question

Is there a way to set the space (margin) between the grid items (in pixels) without changing the size of the grid items? One should think that margin is applicable for this, but changing the margin also changes the size (width and height) of the grid items, which is unfortunate.

Hi @oyshan Did you get any success on this issue?

gaurav-pantelwar avatar May 24 '20 10:05 gaurav-pantelwar