Copying Cell Attributes?
Copying Cell Attributes?
Hello All,
I have a table where a number of discontinuous cells have the same cell shading. Is there an easy way to copy cell shading from one cell to another one?
Also, the manual seems to indicate that one can create styles for table cells, but I'm a bit uncertain how to do that. When I create either a new paragraph or character style, I don't seem to have access to any of the Table Cell palettes.
Thanks in advance,
Josh
I have a table where a number of discontinuous cells have the same cell shading. Is there an easy way to copy cell shading from one cell to another one?
Also, the manual seems to indicate that one can create styles for table cells, but I'm a bit uncertain how to do that. When I create either a new paragraph or character style, I don't seem to have access to any of the Table Cell palettes.
Thanks in advance,
Josh
Re: Copying Cell Attributes?
I don’t know about the first problem but . . .
It’s a Paragraph style you can create and edit in the Style Sheet view.Also, the manual seems to indicate that one can create styles for table cells, but I'm a bit uncertain how to do that.
Re: Copying Cell Attributes?
Hello Kino,
When I try to edit that style, NWP won't allow me to modify the table cell attributes (e.g., to set the cell shading): they are grayed out. I'm not sure if this is a problem with me or my NWP or what.
What I would like to do is set up a number of table cell styles and then apply them to the cells I need, just as I would do with paragraph styles and text.
Thanks,
Josh
When I try to edit that style, NWP won't allow me to modify the table cell attributes (e.g., to set the cell shading): they are grayed out. I'm not sure if this is a problem with me or my NWP or what.
What I would like to do is set up a number of table cell styles and then apply them to the cells I need, just as I would do with paragraph styles and text.
Thanks,
Josh
- martin
- Official Nisus Person
- Posts: 5228
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Copying Cell Attributes?
Hi Josh- I'm afraid that there are no proper table/cell styles in NWP. What we refer to as the "Table Cell" style is just a regular paragraph style that controls font, line spacing, etc. There's no opportunity to systematically control table cell properties like shading, borders, etc. The same goes for your first problem- there's no way to easily copy/sync cell properties between existing cells. The best you can do is to create a multipart selection that includes all the table cells at once (and then change the desired cell properties directly). Sorry to not have better news.
Re: Copying Cell Attributes?
Hi Martin, thanks. Selecting noncontiguous cells will do for now. Of course, it would be nice to either have true table cell styles or to be able to copy and paste cell attributes just like you can do with text attributes (btw, the copy and paste ruler feature of NWP is very nice and handy!).
Josh
Josh
Re: Copying Cell Attributes?
What I would really like to see in this regard is the ability to control these things with macros. I guess there are several ways this could be implemented. If these "styles" were handled in the same way as other styles, then this woud presumably be one possible solution.
philip
Re: Copying Cell Attributes?
If what you want to achieve is something like this, the macro below will help you by making such selections. You still have to apply cell attributes manually, though.goldste4 wrote:Selecting noncontiguous cells will do for now.
Code: Select all
# Put the insertion point somewhere within a table and run the macro.
# You will be asked to specify the starting row number.
$doc = Document.active
if $doc == undefined
exit # no open document
end
$tblsel = $doc.tableSelection
if $tblsel == undefined
exit 'No selection in a table, exiting...'
end
$table = $tblsel.table
if $table.rowCount <= 2
exit 'Table consisting of just one or two row(s), exiting...'
end
$i = Prompt Options 'Select every other row', 'starting from row #', '', 1, 2, 3
$i -= 1
$sels = Array.new
$c = Range.new 0, $table.columnCount
while $i < $table.rowCount
$r = Range.new $i, 1
$sel = TableSelection.new $table, $r ,$c
$sels.appendValue $sel
$i += 2
end
$doc.setSelections $sels
Edit: fixed a typo in the description of the macro.
Re: Copying Cell Attributes?
Thanks, Kino, a very helpful macro. Josh
- greenmorpher
- Posts: 767
- Joined: 2007-04-12 04:01:46
- Location: Melbourne, Australia
- Contact:
Re: Copying Cell Attributes?
Hey, Kino -- can you modify this macro to work with columns instead of rows? That would be a great addition.
Kind regards
Geoffrey Heard
Business writer, Editor, Publisher
The Worsley Press
Kind regards
Geoffrey Heard
Business writer, Editor, Publisher
The Worsley Press
Re: Copying Cell Attributes?
Hiya Geoff. Yes, just by exchanging ‘row’ and ‘column’ and ‘$c’ and ‘$r’ globally except in $sel = TableSelection.new $table, $r, $c near the end.
EDIT: Oup! there was a bug in the macro. I forgot to exchange ‘row’ and ‘column’ in the while . . . line. I corrected the code above and replaced the attached macro file with a corrected version.
Code: Select all
$doc = Document.active
if $doc == undefined
exit # no open document
end
$tblsel = $doc.tableSelection
if $tblsel == undefined
exit 'No selection in a table, exiting...'
end
$table = $tblsel.table
if $table.columnCount <= 2
exit 'Table consisting of just one or two column(s), exiting...'
end
$i = Prompt Options 'Select every other column', 'starting from column #', '', 1, 2, 3
$i -= 1
$sels = Array.new
$r = Range.new 0, $table.rowCount
while $i < $table.columnCount
$c = Range.new $i, 1
$sel = TableSelection.new $table, $r ,$c
$sels.appendValue $sel
$i += 2
end
$doc.setSelections $sels
- greenmorpher
- Posts: 767
- Joined: 2007-04-12 04:01:46
- Location: Melbourne, Australia
- Contact:
Re: Copying Cell Attributes?
Hey Kino
Many thanks. I thought the process you outlined would be correct, but I made an error (or errors) and once off the path didn't know how to find my way back.
I'm sure others will find that useful too.
Cheers, geoff
Many thanks. I thought the process you outlined would be correct, but I made an error (or errors) and once off the path didn't know how to find my way back.
I'm sure others will find that useful too.
Cheers, geoff