LucasBr
LucasBr

Reputation: 481

gridstack.js - how to strech columns to fit width?

I'm trying to use gridstack ( https://github.com/troolee/gridstack.js ) in a configuration of just 5 columns, but the problem is the default is 12 columns, and when I configure to only 5, these 5 columns are squeezed to the left and I have the space of 7 unusable columns on the right.

I would like to use all the screen width to acomodate these columns. Could you help me with the solution? I used options = { width: 5 } and the recommendations on https://github.com/troolee/gridstack.js#change-grid-width , but with no success.

Thank you!

Upvotes: 1

Views: 4058

Answers (2)

danday74
danday74

Reputation: 56936

GridStack.init({
  column: 9
})

Also you will need to import both these CSS files:

node_modules/gridstack/dist/gridstack.min.css // normal Gridstack CSS
node_modules/gridstack/dist/gridstack-extra.min.css // needed if not using 12 columns

Upvotes: 0

Pavel Reznikov
Pavel Reznikov

Reputation: 3208

Have you updated CSS rules for your grid? You need to define new rules for it.

Please check out the documentation https://github.com/troolee/gridstack.js#change-grid-width

Upvotes: 2

Related Questions