How to display elements using Grid ?

Posted 9 years ago
4837 Views
|
2 Replies
|
0 Total Likes
|
 I am making Sudoku Solver using Mathematica. This question is related to display Sudoke puzzle. My blog in Japanese is here. This is an example of nested grids in Document Center. Question 1 Grid[{{a, Grid[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}], b}, {c, d, e}}, ItemSize -> {3, 3}, Frame -> All, Spacings -> {1, 1}, ItemStyle -> {Automatic, Automatic, {{1, 1} -> Directive[Red, 20, Bold], {1, 3} -> Directive[Green, 20, Bold], {2, 2} -> Directive[Blue, 20, Bold]}}] Question 2  Grid[{{a, x, b}, {c, d, e}}, ItemSize -> {3, 3}, Frame -> All, Spacings -> {1, 1}, ItemStyle -> {Automatic, Automatic, {{1, 1} -> Directive[Red, 20, Bold], {1, 3} -> Directive[Green, 20, Bold], {2, 2} -> Directive[Blue, 20, Bold]}}] Would you give me a suggestion how to display elements using Gird ?
2 Replies
Sort By:
Posted 8 years ago
 I learned how to set the font family in Grid. Thank you
Posted 9 years ago
 The following seems to work for your first question: Grid[{{a, Grid[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}], b}, {c, d, e}}, ItemSize -> {3, 3}, Frame -> All, Spacings -> {1, 1}, ItemStyle -> {"FontFamily" -> "Helvetica", Automatic, {{1, 1} -> Directive[Red, 20, Bold], {1, 3} -> Directive[Green, 20, Bold], {2, 2} -> Directive[Blue, 20, Bold]}}] I wonder why this other way the matrix gets mangled: Grid[{{a, Grid[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}], b}, {c, d, e}}, ItemSize -> {3, 3}, Frame -> All, Spacings -> {1, 1}, ItemStyle -> {Automatic, Automatic, {{1, 1} -> Directive[Red, 20, Bold], {1, 3} -> Directive[Green, 20, Bold], {2, 2} -> Directive[Blue, 20, Bold]}}, BaseStyle -> "FontFamily" -> "Helvetica"]