Compartilhar via


PowerPoint.TableColumnProperties interface

Fornece as propriedades da coluna da tabela.

Comentários

[ Conjunto de API: PowerPointApi 1.8 ]

Exemplos

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml

// Specifies the column widths and row heights of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying column widths and row heights.
  shapes.addTable(3, 4, {
    columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
    rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
  });
  await context.sync();
});

Propriedades

columnWidth

Representa a largura pretendida de cada coluna em pontos ou é indefinida.

Quando uma tabela está a ser adicionada, para colunas cuja largura é indefinida, a largura da coluna será calculada ao dividir uniformemente a largura restante da tabela entre essas colunas. Se a tabela não tiver uma largura definida, será utilizada uma largura de coluna predefinida.

Detalhes da propriedade

columnWidth

Representa a largura pretendida de cada coluna em pontos ou é indefinida.

Quando uma tabela está a ser adicionada, para colunas cuja largura é indefinida, a largura da coluna será calculada ao dividir uniformemente a largura restante da tabela entre essas colunas. Se a tabela não tiver uma largura definida, será utilizada uma largura de coluna predefinida.

columnWidth?: number | undefined;

Valor da propriedade

number | undefined

Comentários

[ Conjunto de API: PowerPointApi 1.8 ]

Exemplos

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml

// Specifies the column widths and row heights of a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying column widths and row heights.
  shapes.addTable(3, 4, {
    columns: [{ columnWidth: 100 }, { columnWidth: 200 }, { columnWidth: 100 }, { columnWidth: 200 }],
    rows: [{ rowHeight: 60 }, { rowHeight: 120 }, { rowHeight: 180 }]
  });
  await context.sync();
});