Reply to topic  [ 5 posts ] 
Macro to make columns in table of uniform width 
Author Message

Joined: 2011-01-12 05:32:38
Posts: 256
Hi, all.

I searched the forums, but didn't find anything on this. Is there a macro to force the columns in a table to be all the same width? Or is there another easy way to do this with NWP (2.0.5)?

Attached is a file that shows that the first column is slightly narrower than the other two, thus the text, though uniform in all three columns, takes up more lines in column one.

I think this is happening because the files are being imported into NWP from MS WORD files.

Thanks.


Attachments:
File comment: 3 columns; 1st is narrower
sample of various width columns.rtf [11.79 KiB]
Downloaded 158 times
2013-09-25 00:27:40
Profile

Joined: 2011-01-12 05:32:38
Posts: 256
Ah, I see! Select the Table and then use the Table > Distribute Columns Evenly command. Not so hard after all! An aside: is there a way to see numerically the widths of the columns and tweak them?


2013-09-25 00:30:55
Profile
User avatar

Joined: 2007-02-07 00:58:12
Posts: 876
Location: Japan
NisusUser wrote:
An aside: is there a way to see numerically the widths of the columns and tweak them?


Yes. Since the last update the Nisus Macro language has commands to check and modify various table cell attributes, including the width. You should look in the macro reference (in the help menu).

I haven't had much time to try these things yet, but here is a macro that will give the width of the columns of a the first table in the document. This should give an idea how to start to write a macro that can change the width in the desired way.

Attachment:
Table Width test.nwm [16.42 KiB]
Downloaded 189 times

_________________
philip


2013-09-25 07:04:15
Profile
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
NisusUser wrote:
is there a way to see numerically the widths of the columns and tweak them?

Not using the regular interface, but as Philip says, macros recently gained this functionality.

Here's a macro that shows you the column widths for the selected table and lets you adjust them numerically. As an aside, the macro name "Table Column Width Adjuster" may seem awkward, but once you build up a lot of macros I've found it's very useful to have the names start with a relevant noun. It's very slow to go through a list of macros starting with generic verbs like "Change", "Convert", "Create", etc.


Attachments:
Table Column Width Adjuster.nwm [19.1 KiB]
Downloaded 193 times
2013-09-25 13:02:45
Profile WWW

Joined: 2011-01-12 05:32:38
Posts: 256
Thank you to both of you for your help!


2013-09-25 20:36:53
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software