I use tabular environment in LaTeX.
I want to write a column in a table as a row in the LaTeX code.
For the problem I am writing in LaTeX, it is natural to think of a column at a time.
For example instead of
1 & 3 & 5
2 & 4 & 6
I want to write
1,2
3,4
5,6
Is there some code that I can write for this?


memoirclass provides this kind of capability for simple tabulars. See section Automatic tabulars in the manual (> texdoc memoir). More information if I was permitted to give an answer. – Peter Wilson Jun 11 '18 at 18:26memoirhaving an example frommemoirshowing how it can be done would be very helpful for others. – Alan Munn Jun 11 '18 at 18:49&and\\. Not the case here. – Jun 12 '18 at 07:44\valignanswer should be moved to percusse's answer. Marking this as duplicate extends the scope of original question and makes the green tick and also all the previous upvotes obsoleted and in need of complete revision. – Jun 12 '18 at 09:58duplicatemechanism is for helping OP to get good answer. But in case at hand only 1 of the 4 answers of the original can help, so doesn't OP lose time? and it is sort of luck that original had the appropriate answer. – Jun 12 '18 at 10:02memoiranswer to tabular input by columns (i.e. transpose a table) which is the linked duplicate. – Alan Munn Jun 12 '18 at 18:25memoiranswer does not apply to the linked duplicate but does apply to this question. I disagree with all those who think that this question is a duplicate. – Peter Wilson Jun 12 '18 at 18:34pgfplotstablepackage is more generic than thememoirclass-specific solution. I will now be quiet but unhappy about how "duplicate" works. – Peter Wilson Jun 12 '18 at 19:20