1
$\begingroup$

We have used below code to generate a grid

 redCircle = Graphics[{Red, Disk[Scaled[{.01, .01}]]}]; 
  greenCircle = Graphics[{Green, Disk[Scaled[{.01, .01}]]}];

  grids = Grid[{

      {"Numbers", "Se-1", "Se-2", "Se-3"},
      {"result1", redCircle, greenCircle, greenCircle},
      {"result2", greenCircle, redCircle, redCircle}},


   ItemSize -> {{Scaled[.1], Scaled[.06], Scaled[.06], Scaled[.06]}, 1},
   Frame -> All, FrameStyle -> Directive[Black, Thick]
]

Although, we exploit Alignment in order to center circles in their cells of the grid but unfortunately we could not do that. How can we center circles in their own cells?

$\endgroup$
  • $\begingroup$ What do you mean by "...unfortunately we could not do that" ? It did not work for you ? $\endgroup$ – Lotus Apr 20 '18 at 7:27
3
$\begingroup$
redCircle = Graphics[{Red, Disk[{1, 1}, Scaled[{.25, .25}]]}];  
greenCircle = Graphics[{Green, Disk[{1, 1}, Scaled[{.25, .25}]]}];

grids = Grid[{{"Numbers", "Se-1", "Se-2", "Se-3"}, {"result1", 
redCircle, greenCircle, greenCircle}, {"result2", greenCircle, 
redCircle, redCircle}}, ItemSize -> {{Scaled[.1], Scaled[.06], Scaled[.06], Scaled[.06]}, 
1}, Frame -> All, FrameStyle -> Directive[Black, Thick]]

This would do just fine

$\endgroup$

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.