This content has been marked as final.
Show 1 reply
-
1. Re: How to swap the contents between the columns?
Marijan Tompa Dec 10, 2010 4:34 AM (in response to Praveen10)Hey!
This swaps just data, not formatting.
// this will swap first and third column swapColumns(1,3); var myTable = (function(){ if(app.selection[0].parent.parent instanceof Table) return app.selection[0].parent.parent; else return app.selection[0].parent; })(); function swapColumns(sourceCol, destCol){ if(sourceCol == destCol)exit(); var sourceColCont = myTable.columns[sourceCol-1].contents; var destColCont = myTable.columns[destCol-1].contents; myTable.columns[destCol-1].contents = sourceColCont; myTable.columns[sourceCol-1].contents = destColCont; }Hope that helps.
--
tomaxxi



