5
$\begingroup$

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?

$\endgroup$
5
$\begingroup$
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]
$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – Hermano Jun 11 '15 at 18:10
  • $\begingroup$ Added mod 1. This could be applied selectively with MapAt. $\endgroup$ – Chris Degnen Jun 11 '15 at 18:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.