TableCell extends Element
표의 셀을 편집하는데 사용되는 API 모델입니다API model used to edit cells in a table.
Methods
append(html)
- html <String> 추가할 HTML <String> HTML String to append.
인자로 넘겨받은 HTML String으로 Element의 뒤쪽에 자식으로 추가합니다The HTML String passed as an argument is added as a child at the back of the Element.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.append('<span>TEXT</span>'); |
prepend(html)
- html <String> 추가할 HTML <String> HTML String to append.
인자로 넘겨받은 HTML String으로 Element의 앞쪽에 자식으로 추가합니다The HTML String passed as an argument is added as a child to the front of the Element.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.prepend('<span>TEXT</span>'); |
deleteCol()
셀이 포함된 열을 삭제합니다Delete a column that contains cells.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.deleteCol(); |
deleteRow()
셀이 포함된 행을 삭제합니다Delete the row containing the cell.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.deleteRow(); |
insertCol([before = false])
- before <Boolean> 셀의 앞에 열을 추가하지 여부
...
- <Boolean> Whether to add a column in front of a cell
Add a column after the cell. If the before value is true, a column is added to the front of the cell.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.insertCol(); // 셀의add 뒤에column 열을after 추가cell
cell.insertCol(true); // 셀의add 앞에column 열을before 추가cell |
insertRow([before = false])
- before <Boolean> 셀의 앞에 행을 추가하지 여부
...
- before <Boolean> Whether to add a row before the cell
Add a row after the cell. If the before value is true, a row is added before the cell.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.insertRow(); // 셀의add 뒤에row 행을after 추가cell
cell.insertRow(true); // 셀의add 앞에row 행을before 추가cell |
setColWidth(value[, unit = 'px'])
- value <Number> 열의 너비값: Width of column
- unit <String> 너비값의 단위: Unit of width ('px', '%'). 기본값은 default 'px'. 표 너비 단위와 같은 단위를 사용해야 합니다.
...
- You must use the same units as the table width units.
Sets the width of the column containing the cell.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.setColWidth(200);
cell.setColWidth(20, '%'); |
setRowHeight(value)
- value <Number> 행의 높이값. 값의 단위는 Height of row. The unit of value is 'px'입니다.
셀이 포함된 행의 높이를 설정합니다Sets the height of the row containing the cell.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.setRowHeight(50); |
setHTML(html)
- html <String> Cell 내부에 설정할 HTML 문자열
...
- <String> HTML string to set inside Cell
Set the HTML string value passed as an argument to the cell's internal HTML.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.setHTML('<p><span>HTML를<p><span>Add 추가합니다HTML. All previously 기존에entered 입력된information 내용은will 모두be 지워집니다erased.</span></p>'); |
setText(text)
- text <String> 셀 내부에 설정할 Text 문자열
...
- <String> Text string to set inside the cell
Set the text string value passed as an argument to the internal Text of the cell.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.setText('텍스트입니다Sample text.'); |
splitCell(row, col)
- row <Number> 분할할 열의 개수
- col <Number> 분할할 행의 개수
...
- <Number> number of columns to split
- col <Number> number of rows to split
Splits a cell into a specified number of columns and rows. There may be restrictions when splitting merged cells.
Code Block |
---|
|
var cell = editor.getAPIModelById('id');
cell.splitCell(2,2); |
...