5

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

1 Answers1

5
Grid[{{"a", "b"}, {"c", "d"}, {"e", "f"}}, Frame -> All, Spacings -> {4, 2}]

Modification 1

Grid[{
  {Framed["a", FrameMargins -> {{1, 1}, {10, 10}}, FrameStyle -> None],
   Framed["b", FrameMargins -> {{1, 1}, {10, 10}}, FrameStyle -> None]},
  {"c", "d"}, {"e", "f"}}, Frame -> All]

Modification 2

Grid[{
  {Item["a", ItemSize -> {1, 3}, Alignment -> Center],
   Item["b", ItemSize -> {1, 3}, Alignment -> Center]},
  {"c", "d"}, {"e", "f"}}, Frame -> All]
Chris Degnen
  • 30,927
  • 2
  • 54
  • 108
  • Unfortunatelly this is not the solution i expect, because all rows get affected. I want that just the first row gets the extra margins surrounding its contents. – Hermano Jun 11 '15 at 18:10
  • Added mod 1. This could be applied selectively with MapAt. – Chris Degnen Jun 11 '15 at 18:22