not able to merge table cells


hello forum,

 

i using indesign 5.5, having problem merge table cells through scripting.

 

i want merge multiple cells in table.

have merge first 3 merge coorectly, script not able merge forth merge.

 

i using,

 

var mydocument=app.activedocument;

var mytextframe=mydocument.spreads.item(0).textframes.item("spread0txtframe0");

var table =mytextframe.tables.firstitem();

 

var t = table.rows.length;

var f = table.rows.length - (t-start row count) // **start row count intiger indicates merge start row

var fn=table.rows.length - (t-end row count)

 

table.columns[1].cells[f].merge table.columns[2].cells[fn];      ////* [1]=starting column,,,[2]= end column

 

 

when pass value first 3 merge works when use forth merge indxing change value of rows.what passing f , fn.

 

example:-

var t = table.rows.length;

var f = table.rows.length - (t-0);

var fn=table.rows.length - (t-5);

table.columns[0].cells[f].merge table.columns[0].cells[fn];   // first merge

 

 

var t = table.rows.length;

var f = table.rows.length - (t-0);

var fn=table.rows.length - (t-0);

table.columns[2].cells[f].merge table.columns[3].cells[fn];   // second merge

 

 

var t = table.rows.length;

var f = table.rows.length - (t-1);

var fn=table.rows.length - (t-1);

table.columns[1].cells[f].merge table.columns[2].cells[fn];   // third merge

 

 

var t = table.rows.length;

var f = table.rows.length - (t-3);

var fn=table.rows.length - (t-3);   

table.columns[1].cells[f].merge table.columns[3].cells[fn];   // forth merge

 

i get

an row merges forth one..

 

 

seperately 4 merge works when fire script merge wrong cells in forth merge.

 

please correct me wrong in script.

your answer apriciated.

 

thanks

ajay

how many rows table have in first place? problem because of previous merges number of rows left such there aren't enough rows left f formed properly.

 

i may off base here because can't see screen captures tried post.

 

dave



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

how to devide a circle into equal parts

"Could not fill because there are not enough opaque source pixels" - not solved by any other thread

Why can't I change the billing info for my account?