const table = figma.createTable(2, 3)
create error:
Uncaught (in promise) RuntimeError: table index is out of bounds
I tried a lot of example from documentation - all works fine except table createTable. Need help
all file for tests:
console.clear()
figma.showUI(__html__) // Update the canvas dimensions here
figma.ui.onmessage = async (msg) => {
console.log('creating');
await figma.loadFontAsync({ family: "Inter", style: "Regular" })
console.log('creating2');
const frameWidth = 800
const frameHeight = 600
const frame = figma.createFrame()
frame.resizeWithoutConstraints(frameWidth, frameHeight)
// Center the frame in our current viewport so we can see it.
frame.x = figma.viewport.center.x - frameWidth / 2;
frame.y = figma.viewport.center.y - frameHeight / 2;
// Border for the chart
const border = figma.createRectangle()
frame.appendChild(border)
border.resizeWithoutConstraints(frameWidth, frameHeight)
border.strokeAlign = 'INSIDE'
border.strokeWeight = 3
border.fills = []
border.strokes = [{ type: 'SOLID', color: {r: 0, g: 0, b: 0} }]
border.constraints = {horizontal: 'STRETCH', vertical: 'STRETCH'}
console.log('creating3');
// Create a table with 2 rows and 3 columns
const table = figma.createTable(2, 3)
console.log('creating4');
// Sets characters for the table cells:
// A B C
// 1 2 3
table.cellAt(0, 0).text.characters = 'A'
console.log('creating5');
table.cellAt(0, 1).text.characters = 'B'
table.cellAt(0, 2).text.characters = 'C'
table.cellAt(1, 0).text.characters = '1'
table.cellAt(1, 1).text.characters = '2'
table.cellAt(1, 2).text.characters = '3'
console.log('creating6');
frame.appendChild(table);
figma.closePlugin()
}