Questions tagged [grid-layouts]

Questions about producing vertically and horizontally aligned output.

Useful Links:

377 questions
21
votes
2 answers

Generating schedules/timetables in Mathematica

I've always used MS Excel to create my school schedules, and I've always been happy with the results. Is there a similar GUI way to generate schedules/timetables in Mathematica or a third-party functionality (e.g. in a package) available?? My own…
CHM
  • 3,395
  • 26
  • 46
13
votes
1 answer

Possible to draw an Item in a Grid with only 3 sides of a Frame?

I'm trying to draw a Grid of characters where some of the characters have Frame lines on 3 sides. For example: + + x | x | x +---+ x x x x x x That's something like a Grid[item = Table[x,{3},{3}]], except with item[[1,2]] =…
sblom
  • 6,453
  • 3
  • 28
  • 45
12
votes
1 answer

Arranging elements in a Grid by drag&drop

I have some elements in a Grid. I want to change their positions within that Grid. Can I swap their positions just by dragging cursor on to them? For example Grid[{{1, 2, 5, 7, 9}, {3, 4, 8, 4, 2}, {5, 12, 7, 3, 8}}] I want to swap positions…
Jennifer
  • 953
  • 4
  • 16
12
votes
2 answers

How to set row height in Grid?

I always thought that Grid (and the underlying GridBox) and the general handling of tabular objects is a bit weird in Mathematica. One particularly annoying fact is that while one can set column widths explictly, the same cannot be done to row…
István Zachar
  • 47,032
  • 20
  • 143
  • 291
12
votes
4 answers

Grid - sizing and spacing problems with spanning cells

I am trying to set up a Grid with cells that span two rows and are centered on those rows, but I am having troubles with the sizing and, therefore, spacing of the elements. For illustration I can get something that has at least part of the layout…
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
8
votes
1 answer

Changing the background color of one element in a Grid

Consider the following code: Grid[Table[x, {4}, {7}], Background -> {4 -> LightRed}] This highlights column 4: Grid[Table[x, {4}, {7}], Background -> {None, {4 -> LightRed}}] This highlights row 4: How do you highlight an individual cell, say…
tjm167us
  • 993
  • 5
  • 12
8
votes
3 answers

How to scale the size of Pane to make it fit a Grid element?

I am wanting to make a Pane scale to fit (if Spacings are zero) a Grid element. Grid[{{x, x, Framed[ Pane[x, ImageSize -> {Scaled[1], Scaled[1]}, ImageMargins -> 0, Alignment -> Center], FrameMargins -> 0, ImageMargins…
Mike Honeychurch
  • 37,541
  • 3
  • 85
  • 158
6
votes
1 answer

Spacing and dimension of plots in Grid/GraphicsGrid

There is a way to align axis/picture in this kind of plot? blocks = Table[ Graphics[ Plot[Sin[π i j x], {x, 0, 1}, PlotRange -> {{0, 1}, {-1, 1}}, Frame -> True, FrameTicks -> {{If[j < 2, Automatic, None], None}, …
Fabio
  • 1,357
  • 6
  • 13
6
votes
1 answer

Rotated strings wrapping inside Item of Pane, vs their ItemSize or "ImageSize" spec

Why in this: Grid[{{Item[Rotate["this is a long text example", Pi/2], ItemSize -> {2, 10}]}}, Frame -> True] or this Grid[{{Pane[Rotate["this is a long text example", Pi/2], {59, 300}]}}, Frame -> True] the text length is still wrapped based on…
P. Fonseca
  • 6,665
  • 2
  • 28
  • 60
6
votes
2 answers

Stretch Grid to fit width of containing object?

How can I stretch this Grid to the width of the encapsulating Panel (so that "right" floats on the right side? I want to achieve something along the lines of the menu at the top of the Documentation notebooks. Panel[ Grid[ {{"left",…
mfvonh
  • 8,460
  • 27
  • 42
6
votes
1 answer

Combine two grids in Mathematica

I have the following…
VDF
  • 453
  • 2
  • 7
6
votes
2 answers

Equalizing the column widths in the rows below the title row of a grid

I have a grid I've created with the first row set up as the title to the grid. The problem I'm having is that when the title is wider than the following rows need to be, Mathematica extends the final column of the lower rows to be wider. I'd really…
kgrafton
  • 263
  • 1
  • 7
5
votes
1 answer

How to add margins to a grid cell?

I was not able to figure out how can I add some space (margins) surrounding just the "a" and "b" strings of the following grid: Grid[{{"a", "b"},{"c", "d"},{"e", "f"}}, Frame -> All] How can I do this?
Hermano
  • 311
  • 1
  • 6
5
votes
1 answer

How to set the width of grid elements in pixels?

That is all: How can I set the width of columns in a Grid in terms of pixels instead of 'ems'? To be more precisely, I want to create a grid that is 330 pixels wide, with 3 columns being 110 pixels wide each of them. This could be a…
Vicent
  • 1,101
  • 6
  • 16
5
votes
3 answers

How to control divider length in a grid

I want to display a table like this: And use Divider I can only get this so far t=Table[x, {10}, {10}]; Grid[t, Dividers -> {{{{True, False}}, {-1 -> False, 1 -> False}}, {{{True, False}}, {-1 -> False, 1 -> False}}}] How can…
xslittlegrass
  • 27,549
  • 9
  • 97
  • 186
1
2 3