Skip to main content
Inspiring
July 13, 2023
Answered

How to increase table raw height by 0.1?

  • July 13, 2023
  • 1 reply
  • 338 views

Hi

 

Is there a way to increase or decrease the table raw height by 0.1 without having to write the number? 

This topic has been closed for replies.
Correct answer Eugene Tyson

It can be scripted

and you can add a keyboard shortcut to each script to do it with a key command

 

Increase by .1

var doc = app.activeDocument;

if (doc.selection.length === 1 && doc.selection[0].constructor.name === "Cell") {
  var selectedRow = doc.selection[0].parentRow;
  var currentHeight = selectedRow.height;
  selectedRow.height = currentHeight + 0.1;
} else {
  alert("Please select a single table row before running this script.");
}

 

Decrease by .1

var doc = app.activeDocument;

if (doc.selection.length === 1 && doc.selection[0].constructor.name === "Cell") {
  var selectedRow = doc.selection[0].parentRow;
  var currentHeight = selectedRow.height;
  selectedRow.height = currentHeight - 0.1;
} else {
  alert("Please select a single table row before running this script.");
}

 or just double click the scripts

1 reply

Eugene TysonCommunity ExpertCorrect answer
Community Expert
July 18, 2023

It can be scripted

and you can add a keyboard shortcut to each script to do it with a key command

 

Increase by .1

var doc = app.activeDocument;

if (doc.selection.length === 1 && doc.selection[0].constructor.name === "Cell") {
  var selectedRow = doc.selection[0].parentRow;
  var currentHeight = selectedRow.height;
  selectedRow.height = currentHeight + 0.1;
} else {
  alert("Please select a single table row before running this script.");
}

 

Decrease by .1

var doc = app.activeDocument;

if (doc.selection.length === 1 && doc.selection[0].constructor.name === "Cell") {
  var selectedRow = doc.selection[0].parentRow;
  var currentHeight = selectedRow.height;
  selectedRow.height = currentHeight - 0.1;
} else {
  alert("Please select a single table row before running this script.");
}

 or just double click the scripts

AK09MAuthor
Inspiring
July 19, 2023

Worked perfectly. 👍

Thank you.