Styling Tables

The range class is the heart of table scripting support in Keynote. This class contains the essential style and format properties inherited and shared by cells, rows, and columns. What that means is that a script can use any of the range properties listed below when it targets a cell or a row or a column.

range: A range of cells in a table

elements

contains cells, columns, rows; contained by tables.

properties

alignmentauto align/‌center/‌justify/‌left/‌right ) : The horizontal alignment of content in the range’s cells.

background colorcolor ) : The background color of the range’s cells. Expressed as a list of RGB (Red, Green, Blue) values, from 0 to 65535. For example, the color red is: {65535, 0, 0}

font nametext ) : The font of the range’s cells. Can be the PostScript name (TimesNewRomanPS-ItalicMT), or the full name (Times New Roman Italic). TIP: Use the Font Book application to get the information about a typeface.

font sizereal ) : The font size (in points) of the range’s cells. ex: 12.5

formatautomatic/‌checkbox/‌currency/‌date and time/‌fraction/‌number/‌percent/‌pop up menu/‌scientific/‌slider/‌stepper/‌text/‌duration/‌rating/‌numeral system ) : The cell format of the range’s cells. Default format is automatic.

nametext, r/o ) : The range’s coordinates. A text string expressed as colon-delimited cell IDs. ex: "A2:F6"

text colorcolor ) : The text color of the range’s cells. Expressed as a list of RGB (Red, Green, Blue) values, from 0 to 65535. For example, the color yellow is: {65535, 65535, 0}

text wrapboolean ) : Whether text should wrap in the range’s cells.

vertical alignmentbottom/‌center/‌top ) : The vertical alignment of content in the range’s cells.

responds to

clear, add column after, add column before, add row above, add row below, merge, unmerge.

In Keynote, and in Keynote scripting, ranges are a collection of contiguous cells. Cells are referenced in scripts by their index or by name.

TIP: For a detailed overview of ranges, see the Numbers ranges documentation on this website.

IMPORTANT TIP: Learn how to save and run your favorite scripts using the system-wide Script Menu.

(⬇ see below ) A styled table created with the example script:

styled-table

TOP | CONTINUE