# 표

> 퍼사드 API로 구조화된 PDF 표를 삽입하고 크기를 조정하고 스타일을 지정하고 편집합니다.

- Human documentation: [https://docs.univer.ai/ko-KR/guides/pdfs/features/core/tables](https://docs.univer.ai/ko-KR/guides/pdfs/features/core/tables)

- Agent Markdown: [https://docs.univer.ai/ko-KR/guides/pdfs/features/core/tables.md](https://docs.univer.ai/ko-KR/guides/pdfs/features/core/tables.md)

- Requested language: `ko-KR`

- Content language: `ko-KR`

- Documentation version: `1.0.4`

- Source: [pdfs/features/core/tables.ko-KR.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/pdfs/features/core/tables.ko-KR.mdx)

---

`FPdfTable`은 안정적인 셀 래퍼와 셀마다 하나의 편집 가능한 텍스트 스토리를 가진 구조화된 그리드를 유지합니다.

## 표 삽입 및 편집

```ts
const table = page.insertTable({
  rowCount: 2,
  columnCount: 2,
  cellTexts: ['Owner', 'Status', 'Docs', 'Ready'],
  left: 36,
  top: 36,
  width: 360,
  height: 108,
})

table.resize(3, 2)
table.getCell(2, 0).setText('Legal')
table.getCell(2, 1).setText('Review')
```

행과 열 수는 양의 안전한 정수여야 하며 표는 10,000개 셀을 초과할 수 없습니다. 크기를 조정하면 겹치는 셀이 위치에 따라 유지됩니다.

## 표 테마 적용

```ts
const [preset] = univerAPI.getPdfTableThemePresets()

if (preset) {
  table.setTheme({
    styleId: preset.id,
    options: { firstRow: true },
  })
}
```

`getPdfTableThemePresets()`는 분리된 `{ id, group }` 설명자를 반환합니다. 프리셋의 `id`를 `styleId`로 사용하고 설명자를 `setTheme()`에 직접 전달하지 마세요.

## 셀 스타일

```ts
table.getCell(0, 0).setStyle({
  fill: { color: '#eef3ff' },
  fontColor: '#1d4ed8',
  horizontalAlignment: univerAPI.Enum.HorizontalAlign.CENTER,
  verticalAlign: univerAPI.Enum.PdfTableCellVerticalAlign.MIDDLE,
})
```

`FPdfTableCell.setStyle()`은 컨테이너 필드와 셀 전체의 `fontColor`, `horizontalAlignment`를 받습니다. `PdfTableCellVerticalAlign`은 `univerAPI.Enum`을 통해 사용하세요.

표 메서드는 `getRowCount()`, `getColumnCount()`, `getCell()`, `resize()`, `getTheme()`, `setTheme()`입니다. 셀 메서드는 `getText()`, `setText()`, `getStyle()`, `setStyle()`입니다.
