skip to Main Content

In my project, I created a grid using the GridStack library in the angular framework.
Basically, I want to change the 12 columns to 8 columns but this is not possible.
When I change 12 columns to 8 columns there is free space left in the last 4 columns.

2

Answers


  1. Need to look at your code, but still I can propose a solution. In your HTML, go to that div which you have given ‘grid-stack’ class, assign an attribute of ‘width’ and give it the value 8.
    Still, I would say it would be better if you provide code.

    Login or Signup to reply.
  2. Solution: You need to import gridstack-extra.min.css to use non-12-column option

    There’s an answer in doc.
    https://github.com/gridstack/gridstack.js/tree/master/doc#grid-options

    column(column: number, layout: ColumnOptions = ‘moveScale’)
    set the number of columns in the grid. Will update existing widgets to conform to new number of columns, as well as cache the original layout so you can revert back to previous positions without loss. Requires gridstack-extra.css (or minimized version) for [2-11], else you will need to generate correct CSS (see https://github.com/gridstack/gridstack.js#change-grid-columns)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search