# Tool to flip a table [duplicate]

I am looking for a tool to flip the rows and columns of a tablular table.

For example

\begin{tabular}{lll}
1 & 2 & 3 \\
4 & 5 & 6
\end{tabular}


should become

\begin{tabular}{ll}
1 & 4 \\
2 & 5 \\
3 & 6
\end{tabular}


This is possible using TeXlipse. I would however prefer a simpler solution with less overhead.

Ideally

• it should run on Linux, however an online solution would be acceptable too if there is one, and
• whatever possible in cells is conserved (comments for instance)

## marked as duplicate by Peter Grill, cfr, Andrew Swann, Svend Tveskæg, Mico tables StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Nov 9 '14 at 19:53

• Welcome to TeX.SE. If the linked question above does not answer your question please edit the question and explain why. Otherwise we'll close this question as a duplicate. Also, for future reference while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Nov 9 '14 at 19:21