I don't usually cross-post, but I thought there might be people who don't usually look in the macro forum, but might nevertheless be interested in such a thing.
Below is a macro that will flip a table's rows and columns. It works for tables with different numbers of rows and columns, and it also works with tables that have merged cells. it also copies cell edge attributes, and it tries to preserve the size of the table and the relative widths and heights of the rows and columns, as far as possible.
Here is a sample output:
If this is of interest, the macro can be downloaded from this thread:
http://www.nisus.com/forum/viewtopic.php?f=17&t=5512
Swapping Rows and Columns of a Table
- greenmorpher
- Posts: 767
- Joined: 2007-04-12 04:01:46
- Location: Melbourne, Australia
- Contact:
Re: Swapping Rows and Columns of a Table
Thank you Philip. Neat.
Cheers, geoff
Cheers, geoff
Re: Swapping Rows and Columns of a Table
Brilliant!
Edit:
…only that Table Cell Shading attributes are dropped.
…and the padding.
nag, nag.
Edit:
…only that Table Cell Shading attributes are dropped.
…and the padding.
nag, nag.

Sebastian
Re: Swapping Rows and Columns of a Table
Well, tell that to Nisus-soft. Yes, why can't we have macro control of cell shading?sebwin wrote:Edit:
…only that Table Cell Shading attributes are dropped.
…and the padding.
nag, nag.
philip
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Swapping Rows and Columns of a Table
Philip, thanks for providing this excellent macro (and others)!
PS: Sebastian, I love your forum avatar.
Consider us told! It's actually not that we didn't think of it, or want to add it, but there just wasn't enough time to sneak it into Pro 2.0.6. Don't worry, it's still on the list.phspaelti wrote:Well, tell that to Nisus-soft. Yes, why can't we have macro control of cell shading?sebwin wrote:Edit:
…only that Table Cell Shading attributes are dropped.
…and the padding.
nag, nag.
PS: Sebastian, I love your forum avatar.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Swapping Rows and Columns of a Table
There's no support for table cell padding in the macro language yet, but the just released Nisus Writer Pro 2.0.7 did add support for cell shading. There's also support in 2.0.7 for inspecting and controlling paragraph shading attributes.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Swapping Rows and Columns of a Table
Thanks Philip, you're always on top of things!