How do I flip the orientation of a grid?
I'm just doing a simple Grid[datasymb开发者_JAVA技巧olgoeshere, Frame->All]
command. It's taking a list of ID numbers (e.g., {11282,11281,11280}) and placing each one in its own column. I just want to flip the orientation so all strings in a single list are placed in the same column (individual rows, one on top of another), and the next list of strings goes in the second column.
Sounds like you want
Grid[Transpose[datasymbolgoeshere],Frame->All]
Edit -- by the way Grid
assumes a multidimensional list. It won't complain if you call, eg Grid[{1,2}]
but Mma cannot simplify that expression and just returns it as-is. Grid
will work with a ragged array, but Transpose
will complain, so you will need to pad the elements of datasymbolgoeshere
to make your array rectangular.
Putting it all together, something like this should work on most inputs
With[
{
maxLength=Length/@data//Max
},
PadRight[#,maxLength,""]&/@data//Grid[#,Frame->All]&
]
Rotate[Grid[datasymbolgoeshere, Frame->All],90 Degree]
I like that the contents are still selectable.
精彩评论