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.

grid-layout
Filter by
Sorted by
Tagged with
4 votes
1 answer
15k views

Panel grid layout in PrimeFaces

I want a layout of <p:panelGrid> (or <h:panelGrid>) as shown in the following snap shot. The following code, <p:panelGrid style="width: 100%;"> <p:row> <p:...
Tiny's user avatar
  • 27.6k
4 votes
3 answers
4k views

GridLayout not honoring the number of rows I want per column

I have the following, GridLayout layout = new GridLayout(4, 0); In the event that I have 5 items, this will create 2 columns, where the first contains 3 rows and the second contains 2 rows. This is ...
mre's user avatar
  • 43.9k
4 votes
2 answers
17k views

Adding buttons using gridlayout

I'm trying to create a simple tic tac toe board made by 9x9 JButtons. I used a 2d array and a gridlayout but the result is nothing, a frame without any button. What I'm doing wrong? import java.awt....
Imri Persiado's user avatar
4 votes
2 answers
5k views

GridLayout wrong number of columns

I'm trying to create panel with a GridLayout(7,2) membersPanel = new JPanel(new GridLayout(7,2)); However, when I add the components (Labels, Combobox, textfields, etc) the components show up in 3 ...
SaintLike's user avatar
  • 9,319
4 votes
2 answers
10k views

Get BottomSheetBehaviour from BottomSheetDialog

This is my layout for BottomSheetDialog. I've a grid layout inside as well. That grid layout's scrolling is not proper. I mean it scrolls only in expanded state of BottomSheetDialog. <LinearLayout ...
div's user avatar
  • 1,493
4 votes
2 answers
3k views

Grid with viewport height and inner scrolling div

I'm trying to create a layout that uses a grid that takes up the entire browser viewport (height: 100vh) and then allows a div within one of the grid items to scroll in the Y dimension. Here's some ...
Rob N's user avatar
  • 15.6k
4 votes
2 answers
7k views

css-grid 2x2 or 2x3 layout, depending on number of items

Consider a schedule with a variable number of items, anywhere between 1 and 6. If there are 1 - 4 items, they should cover a 2x2 layout, like: ONE TWO THREE FOUR If there are 5 - 6 items, they ...
Timm's user avatar
  • 158
4 votes
1 answer
4k views

Grid columns using flexbox with fixed size margin gutters

Is it possible to apply a fixed margin (e.g. 5px) to a cell in a flexbox layout, where the row space is evenly distributed among its columns? Want I want to achieve: My current CSS will only align 3 ...
Imperative's user avatar
  • 3,148
4 votes
2 answers
4k views

How to remove space between ImageIcons in GridLayout (Java)

I am making a java game reliant on having tiles in a grid. I have used ImageIcon, along with JLabel in a GridLayout. I have set both the vertical and horizontal to zero when I created the GridLayout, ...
Primus's user avatar
  • 65
4 votes
2 answers
11k views

In Bootstrap how to get two rows with different dimensions beneath each other

I'm using Bootstrap 3. I have two rows. The first row has 4x3 columns. The second row has one column of 3 and one column of 9. The column of 9 has twice the height of all the other columns. I would ...
timmy's user avatar
  • 478
4 votes
1 answer
3k views

Centering Radio Buttons in a GridLayout

I am trying to create an application using GridLayout and I don't know how to center some radio buttons. The window ends up looking like: Here is how I added the radio buttons: JPanel qArea = new ...
Casteurr's user avatar
  • 956
4 votes
3 answers
4k views

How to use GridBagLayout and GridLayout for optimum alignment?

I wanted to try out GridBagLayout in my program but sadly I don't clearly understand it, I tried implementing GridLayout also but both give me different problems. Let me show you the code and the ...
Hanzyusuf's user avatar
  • 379
4 votes
3 answers
2k views

Printing a dict of lists as a grid-layout

Ok, I read all of these before and I think pandas could be a solution, but my problem is slighly different: Print a dictionary of lists vertically Printing Lists as Tabular Data print dictionary ...
Ando Jurai's user avatar
  • 1,033
4 votes
3 answers
3k views

Create table-like grid with CSS starting from a simple HTML list

Is there any way in CSS to create this: ----------------------------------- | lorem ipsum dolor | consectetur | | sit amet | | ----------------------------------- | adipiscing ...
wc.matteo's user avatar
4 votes
4 answers
1k views

What kind of display are the direct child elements of a container using display: grid?

If there is just a p tag in the HTML that has a background color of blue, and has margin: auto, then it takes up the width of the page, and the width and padding can be changed, like an inline-block. ...
user avatar
4 votes
1 answer
2k views

group a flextable, a ggplot, a text and an image together into a grid object, then add it to a powerpoint slide

I want to know if it's possible to group a flextable/regulartable, a ggplot, a text and an image together into a grid object, and then put that grid in a PowerPoint slide? This could be very useful ...
Popescu Gabriel's user avatar
4 votes
2 answers
5k views

Count how many elements in dynamic row

When using CSS Grid Layout to dynamically arrange elements in rows the browser calculates how many items go in a row depending on the size of the viewport. I'm looking for a way using JavaScript to ...
bloodyKnuckles's user avatar
4 votes
3 answers
266 views

Unable to set BoxLayout(JPanel) correctly in GridLayout/FlowLayout

I have a panel with the below code public class PhotoBox extends JPanel { private JLabel photoIcon; private JLabel photoName; private JLabel print; private ImageHelper imageHelper; ...
ItachiUchiha's user avatar
  • 36.5k
4 votes
1 answer
735 views

Grid Layout Width Issue

I have been developing an app for which I also need to handle the UI stuff too. Heres my XML: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="...
Umayr's user avatar
  • 97
4 votes
3 answers
7k views

GridLayout of Buttons to Output a Checkerboard

I am programming in Java and am still rather new. Experimenting with GUI Basics, I decided to make a checkerboard with all 64 cells being instances of JButtons with a filled in background. Sadly, when ...
Alex's user avatar
  • 43
4 votes
1 answer
4k views

Grid columns spanning full width inside Bootstrap 3 tab-pane

I can't seem to get this to work - my columns go full width. Here's a JSfiddle for direct use <div class="container-fluid"> <div class="panel panel-default"> <div class="panel-body"&...
Hamy's user avatar
  • 21.1k
4 votes
4 answers
5k views

How to fit image to frame keeping aspect ratio and center in thumbnail list

I want to show list thumbnail box as data grid. each thumbnail image has to be placed in frame with specific width and height (for consistency) as follow: <div class='frame'> <img src='...
Credion Mois's user avatar
4 votes
1 answer
4k views

How to vertically fill a JPanel with GridLayout or GridBagLayout?

I want to fill a JPanel whose layout is GridLayout, if it's not possible using GridLayout i would like to know if using GridBagLayout is possible and how? Here's the code: public class ...
Jonathan Solorzano's user avatar
4 votes
1 answer
4k views

Responsive Grid Layout - Dashboard Style - 100% height&width container

Am looking to make this a pure responsive css grid for 11 html divs. <div class="dashboard page-container">w100%, h100% <div class="box1">w20%, h25%</div> <div class="...
StackThis's user avatar
  • 883
4 votes
2 answers
10k views

GridView, GridLayout or TableLayout?

I need to create some screens similar to this one: Also, if the user wants to show more buttons per screen, it would be something like this: Today I am using LinearLayouts to do this. I would like ...
Carlos Pereira's user avatar
4 votes
3 answers
708 views

How to reduce the space between the 3 swing checkboxes?

I want to reduce the size between the components with in the Formatting group (left side on the image). How to do this? JPanel formattingGroup = createGroupWithName("Formatting"); ...
Aravind Yarram's user avatar
4 votes
1 answer
10k views

Why are my css grid items overlapping when arranged in a particular layout?

I am a noob trying to learn css grid layout. I'm trying to create a grid-layout using grid-template-areas. However,the items keep overlapping because I have to explicitly specify the height of the ...
glitterShimmer's user avatar
4 votes
1 answer
16k views

Safari css height: auto; and height: 100%; stretches image. Does not happen in firefox or chrome

I have square images in a grid. The css says the width of each is 25%. The height should be set to auto. What you should get is a row of 4 straight across. What I get instead is width: 25%; height: ...
Stacyalert's user avatar
4 votes
1 answer
4k views

How to reorder bootstrap columns vertically

I'm trying to build the following layout in Bootstrap v3: | Small | Large | |--------------|--------------------| | [A ] | [A ][B ] | | [A.1 ] | [A.1 ...
KyleMit's user avatar
  • 34.2k
4 votes
2 answers
2k views

Nested rows in Bootstrap 3 fail to respect the grid?

Bootstrap seems to break its own grid once you get into nested rows. This is a good example: div { border: 1px solid gray; } <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/...
Thomas David Baker's user avatar
4 votes
2 answers
1k views

CSS mask for image grid

How to create an image grid with images nicely lined up in same height rows and same width columns, giving we could have pictures of different aspect ratios in responsive design, in CSS? Let's take ...
Jan Desta's user avatar
  • 529
4 votes
2 answers
855 views

Java: How to nest JPanel in a GridLayout?

I want to know how to nest JPanels using a GridLayout. This is how it should look like. I approached this problem by 2 ways so far, using JPanels and using JLabels, and none of them worked (only ...
HishamGarout's user avatar
  • 1,763
4 votes
1 answer
2k views

Making responsive grid elements fit by height

I'm trying to get my head around working with responsive webdesign (by column stacking) and I'm currently using this grid for my layouts: http://www.responsivegridsystem.com/ which I think works quite ...
bomortensen's user avatar
  • 3,376
4 votes
2 answers
9k views

How GridLayout items come from the Adapter(List/Image) in Android App

Is it possible to Get the GridLayout items from the Adapter in Android. Like, The items in the GridView come from the ListAdapter associated with this view. Please clarify my doubt.. Thanks
Lakshmi Sreekanth Chitla's user avatar
4 votes
2 answers
3k views

Creating a grid like layout in Android

Basically, I have a view that needs to be split up into a 2x4 grid, with each section equal in size (i.e. each row would be 25% of the screen height, and each column would be 50% of the screen width). ...
user avatar
4 votes
1 answer
4k views

Why are empty columns not collapsing in CSS Grid?

I have started learning CSS Grid from yesterday and I have a doubt. I was reading about how can I use auto-fit to place the elements evenly in the rows from this website. The post says that auto-...
Yogesh Tripathi's user avatar
4 votes
2 answers
1k views

CSS Grid - Transitioning from 1 row, 3 col to 3 row, 1 col

I'm exploring CSS Grid to see if it can completely replace the need for responsive CSS media queries for my specific use case. I have the following grid container: .gridContainer { display: grid;...
Shandy's user avatar
  • 311
4 votes
2 answers
87 views

I can't get grid-template-areas to work in html

I'm trying to use grid-areas to have a 30%/70% split in a box with an image on the left and text on the right, but they keep overlapping and I don't know how to fix it. Image isn't showing up in ...
Louis B.'s user avatar
4 votes
2 answers
2k views

CSS - Responsive grid with equal margins and fixed size blocks

I'm trying to push the limits of CSS to replicate what would be a common grid-layout in print. Requirements : Margins between blocks and between blocks and edge of the container must be equal. The ...
Ryan Norbauer's user avatar
4 votes
3 answers
4k views

How to align content differently for xs and md in material ui grid

I am using material ui Grid component to create a responsive grid layout. And I want to align the content inside grid depending on the screen size - alignt left for xs and align right for md. How do I ...
troglodyte07's user avatar
  • 3,878
4 votes
1 answer
386 views

CSS - Make an item start in the middle of previous row

I'm trying to use CSS Grid to have a div that starts in the middle of the div in the row above. I want both divs to wrap around the text. This is what I'm trying to achieve: As you see on the picture,...
Marie D.'s user avatar
  • 201
4 votes
1 answer
1k views

With CSS Grids, is there a way to wrap the implicit grid when using grid-auto-flow: column?

I'm trying to implement a layout with a 4x2 grid that flows (using grid-auto-flow: column) into a second 4x2 grid underneath. In essence, I'm trying to cut an 8x2 grid in half and laying the two ...
bdnk's user avatar
  • 51
4 votes
1 answer
2k views

android.support.v7.widget.GridLayoutManager$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams

activitymain.xml <android.support.v7.widget.RecyclerView android:background="@color/primary_text" android:layout_marginStart="@dimen/...
Ankur Khandelwal's user avatar
4 votes
1 answer
158 views

How to create a responsive (regarding parent size) DIV with fixed aspect ratio and limited max-height?

Keeping the aspect ratio of a <div> or similar element while being responsive to the parent's size seems to be a common problem. The solution that is widely regarded across the net as being the ...
inVader's user avatar
  • 1,524
4 votes
1 answer
3k views

Drag and Drop Reorder controls within Grid panel WPF

I am almost new to WPF. I have a Grid panel shown in the picture. I want to add the drag & drop functionality so that a user can reorder the buttons within the cells of the grid (The user should ...
Mehrdad Kamelzadeh's user avatar
4 votes
1 answer
1k views

GridLayout compatibility - ClassNotFoundException: Didn't find class "android.support.v7.widget.GridLayout"

I'm trying to use GridLayout in my Android 2.2 project, and after having installed the gridlayout_v7 project in my workspace, adding it to my projects Android Dependencies, adding a custom xmlns for ...
saarraz1's user avatar
  • 3,009
4 votes
2 answers
2k views

gridlayout's children visibility gone

This is my .xml. When I touch the cell - visibility sets as View.GONE, but it just disappearing as View.INVISIBLE. There is an empty space in the place when cell was. The size of cells is fixed. How ...
ant's user avatar
  • 407
4 votes
2 answers
206 views

Css grid, large size on some cards, how to place them like this

I'm using grid for this layout and I'm halfway through. As you can see number 10,20,30,40,50 gets placed on the same spot (I place them there). I would like to have my layout as from 1 to 10 are ...
Dejan.S's user avatar
  • 18.9k
4 votes
0 answers
2k views

How do I include the Android GridLayout support library in my Android project?

I am trying to add the backwards compatible Gridlayout library to my android project but I can't get it working. And, I have read all other articles on google and on stackoverflow but it still does ...
user2426316's user avatar
  • 7,221
4 votes
2 answers
7k views

Drag and drop items around GridLayout - Android

I have a GridLayout with some items in it. Nothing special on it. I just would like to know if I can drag items around and make the other items automatically arrange themselves. It's like Android ...
Carlos Pereira's user avatar

1
3 4
5
6 7
44