• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[JS]

Enthusiast ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Hello everyone,

I can not put the outer border of the painting 2 pt before or after that of the cells.

It works if I pass line 16 in comment.

Any ideas ?

Thank you very much.

/*************************/

Salut tout le monde,

Je ne parviens pas à mettre la bordure extérieur du tableau à 2 pt avent ou après celle des cellules.

Cela fonction si je passe la ligne 16 en commentaire.

Quelqu'un à une idée ?

Merci beaucoup.

if(app.selection.length != 0 && app.selection[0].constructor.name == 'Table'){

               

            var nomTableau = app.selection[0];

              parDefaut(nomTableau);

                $.writeln(nomTableau.topBorderStrokeWeight);

                exit();           

        } else{

                alert("Selection un tableau");

                // faire sur la totalité des tableaux

                exit();

}

function parDefaut(nomTableau2){

            with (nomTableau2.cells.everyItem()){

                        topEdgeStrokeWeight = bottomEdgeStrokeWeight = leftEdgeStrokeWeight = rightEdgeStrokeWeight = '0.3 pt';

                       

        } /// with     

         with (nomTableau2) {

                        spaceBefore  = spaceAfter = '2mm'; // espace avant et  après sur 2

                        topBorderStrokeWeight = bottomBorderStrokeWeight = leftBorderStrokeWeight = rightBorderStrokeWeight = '4 pt';

                     

              }

                      $.writeln(nomTableau.topBorderStrokeWeight);       

}

TOPICS
Scripting

Views

181

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

Hi Philippe,

Apparently, you need to use cell styles!

(^/)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

LATEST

Hi Obi-wan

Oops, I have not put title !!!!


The behavior is not very logical, if we modify the borders of the cells (are they priority?), The modification by a JS of the external borders of a table no longer applies due to having locally modified the bodures Of cell (without style) !!!


I'm meditating on the subject ... between creating a default cell style with a table style for the outer border ... or doing locally ...

-----

Oups, j'ai pas mis de titre !!!!

Le comportement n'est pas très logique, si on modifie les bordures des cellules (sont-elles prioritaire?), la modification par un JS des bordures externe d'un tableau ne s'applique plus du fait d'avoir modifié localement les bodures de cellule (sans style)  !!!

je médite sur le sujet ... entre crée un style de cellule par défaut avec un style de tableau pour la bordure externe ...  ou faire localement ...

if(app.selection.length != 0 && app.selection[0].constructor.name == 'Table'){

               

            var nomTableau = app.selection[0];

              parDefaut(nomTableau);

                $.writeln(nomTableau.topBorderStrokeWeight);

                exit();           

        } else{

                alert("Selection un tableau");

                // faire sur la totalité des tableaux

                exit();

}

function parDefaut(nomTableau2){

            with (nomTableau2.cells.everyItem()){

                topEdgeStrokeWeight = bottomEdgeStrokeWeight = leftEdgeStrokeWeight = rightEdgeStrokeWeight = '0.5 pt';

                       

            } /// with     

   

                nomTableau2.rows[0].topEdgeStrokeWeight = '3 pt';

                nomTableau2.rows[-1].bottomEdgeStrokeWeight = '3 pt';

                nomTableau2.columns[0].leftEdgeStrokeWeight = '3 pt';

                nomTableau2.columns[-1].rightEdgeStrokeWeight = '3 pt';

   

         with (nomTableau2) {

                        spaceBefore  = spaceAfter = '2mm'; // espace avant et  après sur 2

                      //  topBorderStrokeWeight = bottomBorderStrokeWeight = leftBorderStrokeWeight = rightBorderStrokeWeight = '3 pt';

        

         }

                      $.writeln(nomTableau.topBorderStrokeWeight);       

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines