Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table extends Element

표를 편집하는데 사용되는 API 모델입니다The API model used to edit tables.

Methods

Table of Contents
maxLevel3
minLevel3

...

deleteCol(startIndex[, endIndex])

  • startIndex <Number> 삭제할 열의 시작 위치 (0부터 시작<Number>  :  The start position of column to delete (starts from 0)
  • endIndex <Number> 삭제할 열의 끝 위치

...

  • :  The end position of column to delete

Deletes the specified column from the table. The startIndex value starts from 0, and if endIndex is not specified, only the column corresponding to startIndex is deleted.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.deleteCol(1);	// 두번째Delete the 열을second 삭제column
table.deleteCol(1,3); // Delete 두번째from 열부터second 네번째to 열까지fourth 삭제column

deleteRow(startIndex[, endIndex])

  • startIndex <Number> 삭제할 행의 시작 위치 (0부터 시작<Number>  :  The start position of row to delete (starts from 0)
  • endIndex <Number> 삭제할 행의 끝 위치

...

  • :  The end position of row to delete

Deletes the specified row from the table. The startIndex value starts from 0, and if endIndex is not specified, only the row corresponding to startIndex is deleted.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.deleteRow(1);	// Delete 두번째the 행을second 삭제row
table.deleteRow(1,3); // 두번째Delete from 행부터second 네번째to 행까지foruth 삭제row

deleteContents()

표 안쪽 셀의 모든 내용을 삭제합니다Deletes all contents of cells inside the table.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.deleteContents();

insertCol(index)

  • index <Number> 추가할 열의 위치

...

  • <Number>  :  Position of the column to be added

Adds a column at the specified location.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.insertCol(1);

insertRow(index)

  • index <Number> 추가할 행의 위치

...

  • :   Position of the row to be added

Adds a row at the specified location.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.insertRow(1);

mergeCell(startRowIndex, startColIndex, endRowIndex, endColIndex)

  • startRowIndex <Number> 병합할 행의 시작 위치:  Start position of row to be merged
  • startColIndex <Number> 병합할 열의 시작 위치:  Start position of column to be merged
  • endRowIndex <Number> 병합할 행의 끝 위치:  End position of row to be merged
  • endColIndex <Number> 병합할 열의 끝 위치

...

  • :  End position of column to be merged

Merges the specified cells.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.mergeCell(0, 0, 1, 2);

replace(html)

  • html <String> 교체할 :  The HTML String to replace.

Element 자신을 인자로 넘겨받은 HTML String으로 교체합니다Replaces the element itself with the HTML String passed as an argument.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.replace('<span>Table replaced</span>');

remove()

Removes the Element 자신을 제거합니다itself.

Status
subtletrue
colourRed
title모든 Element를 제거할 경우 이후의 작업에서 오류가 발생할 수 있습니다If all elements are removed, errors may occur in subsequent operations.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.remove();

setColWidth(index, value[, unit = 'px'])

  • index <Number> 설정할 열의 위치: Position of the column to set.
  • value 너비값: Width
  • unit 너비값의 단위 : Unit of width('px', '%'). 기본값 default 'px'.

지정된 열의 너비를 설정합니다.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.setColWidth(1, 100, 'px');
table.setColWidth(1, 20, '%');

setRowHeight(index, value)

  • index <Number> 설정할 행의 위치: Position of the row to set.
  • value 높이값. 행의 높이는 : Height. Row height can only be set to 'px'로만 설정 할 수 있습니다.

...

  • .

Sets the height of the specified row.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.setRowHeight(1, 100);

setHeight(value[, unit = 'px'])

  • value<Number> 높이값: height
  • unit <String> 높이값의 단위 <String> : Unit of height ('px', '%'). 기본값 default 'px'.

표의 높이를 설정합니다Sets the height of the table.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.setHeight(200);
table.setHeight(200, 'px');

setWidth(value[, unit = 'px'])

  • value<Number> 너비값: Width
  • unit <String> 너비값의 단위 : Unit of width ('px', '%'). 기본값 default 'px'.

표의 너비를 설정합니다Sets the width of the table.

Code Block
languagejs
themeEmacs
var table = editor.getAPIModelById('id');
table.setWidth(400);
table.setWidth(100, '%');

...