How do I change the order of columns in a table? I have too many rows and doing this manually would be a horrible pain.

A MWE to get us going (let's get rid of Yoda!):



    \begin{tabular}{c c c c}
        \hline \hline
        this & in & order & is \\ \hline\hline
        1    & 3  & 4     & 2  \\
        a    & c  & d     & b  \\


enter image description here

  • honestly this may be done with a simple regular expression in your editor and will be much more reliable and robust than doing it in tex macros. Commented Aug 19, 2016 at 9:23


Browse other questions tagged .