Questions tagged [grid-layout]

Grid layout is used to align content into columns and fields. Unlike table layouts, grids are composed of guide lines so that elements positioned relative to the grid can have drag and drop behavior.

GridLayout is similar by concept to the table layout, placing objects into multiple rows and columns so that all cells in the same column usually have the same width.

grid layout is a "CSS table" that allows to divide available space into columns and rows using a set of predictable sizing behaviors. Unlike HTML table, CSS grid layout is defined in CSS, placing HTML objects into the cells by id.

GridLayout supports cell padding and may have unspecified number of rows (there are enough rows to place all elements using the specified number of columns, new rows are added as required). It does not support cells spanning over multiple rows or columns (another layout, GridBagLayout does).

Resources

2180 questions
19
votes
3 answers

How to add android.support.v7.widget.GridLayout into intelliJidea?

I want to add GridLayout into my android project which is use support library GridLayout v7. I found this thread but maybe a few steps of adding this library did not mention in this paragraph Set up support GridLayout library in IntelliJ. can anyone…
Misagh Aghakhani
  • 1,023
  • 2
  • 13
  • 29
17
votes
7 answers

How to get X and Y index of element inside GridLayout?

I am studying a java tutorial and saw that the way to find the x/y indexes of a JButton inside a GridLayout is to traverse a bidimensional array of buttons b which is associated to the layout and checking if b[i][j] == buttonReference. @Override …
Răzvan Flavius Panda
  • 21,730
  • 17
  • 111
  • 169
17
votes
1 answer

Set css grid child element's size on the grid, without specifying what column or row it should go into

Is it possible do set a div's height and width in amount of rows/columns they should span, without specifying exactly which columns or rows they should go into? For example, if I have two classes, say .long and .wide, and I want the .long class to…
Siebe
  • 305
  • 1
  • 3
  • 10
17
votes
1 answer

CSS grid layout: support grid-area for IE11

Сan someone tell me how to make this example work in ie11? I checked the documentation and -ms- prefix did not help #page { display: -ms-grid; display: grid; width: 100%; height: 250px; grid-template-areas: "head head" "nav main" "nav …
Pavel
  • 2,103
  • 4
  • 23
  • 41
16
votes
3 answers

How can I make a div span multiple rows and columns in a grid?

Building off of a previous question, I'm trying to add bigger blocks to my grid layout. In the last question, I needed to have a div span multiple rows. The problem now is that I need a div to span multiple rows and columns. If I have a…
PaulCo
  • 1,398
  • 4
  • 17
  • 31
16
votes
2 answers

Android: How to create a GridLayout [not GridView] programmatically?

I am developing a "match the following" application. The xml used for the application is as follows:
Srikanth
  • 306
  • 1
  • 2
  • 10
15
votes
1 answer

Java Swing GridLayout "Cell span"?

Is there a way to make a single element in a Grid layout take up more than 1 location in a grid. Example: I want to create a textbox that takes up an entire grid row, is there some way to do this?
HunderingThooves
  • 962
  • 8
  • 20
  • 33
15
votes
1 answer

CSS grid, remove gap when area is optional

I'm starting using CSS grid (pretty amazing!). I'm starting with the most basic layout: mobile layout. Also, I'm using media queries to change the layout as the web page grows. For now, my layout consists of 3 areas. The exact order is the content…
Marco
  • 2,687
  • 7
  • 45
  • 61
15
votes
4 answers

Masonry layout with css grid

I'm trying to create masonry layout using css grid layout. All items in grid have variable heights. And I don't know what items will be. So I can't define grid-row for each item. Is it possible to start each new item right after end of previous in…
user2950602
  • 395
  • 1
  • 7
  • 21
15
votes
7 answers

Auto fit according to screen size in grid layout android

I have created a grid containing full of texts. I want the text to auto-fit according to screen size. I have tried the following code, DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); float dpWidth =…
Anusha
  • 939
  • 3
  • 13
  • 31
15
votes
3 answers

Top navbar overlaps with main content

I'm converting my landing page from Bootstrap to Semantic-UI. The page has a position fixed top navbar. The main content is divided in two columns (3-cols and 9-cols). The left column is used to show a sidebar and the right column is used for…
stanleyxu2005
  • 8,081
  • 14
  • 59
  • 94
15
votes
5 answers

Load arrayList data into JTable

I'm trying to set items from a method called FootballClub and so far it's fine. but then I created an arrayList from it and I somehow can't find a way to store this information into a JTable. The problem is that i cant find a way to set a fixed…
jPratas
  • 225
  • 1
  • 6
  • 17
15
votes
1 answer

Possible to add offset to the right of an element in a Zurb Foundation 4 grid?

According to Foundation's docs on the grid component, I can essentially make 1 or more grid columns a space using their offset classes:
1st column
2…
at.
  • 50,922
  • 104
  • 292
  • 461
15
votes
1 answer

Responsive Grid Layout Framework

I want an easy to use grid framework for my current web project. These are the features i would appreciate: fluid grid layout: boxes that can be aligned horizontally (side by side), each having the same height (for example a 3-column layout),…
Alp
  • 29,274
  • 27
  • 120
  • 198
14
votes
2 answers

How to make Android GridLayout compatible to older version?

New GridLayout for Android 4 is good. Both in terms of code maintainability and performance. I wanted help with backward compatibility for GridLayout for older version. Waiting for official compatibile package is taking too long. I know its possible…
Siddharth Menon
  • 587
  • 1
  • 8
  • 21