Cell write function

Default function will simply write to the HTML and tell the DataTable
to update.

@type   {function}
@param  {node} cell `th` / `td` element to write the value to
@return {string}    Data two write
962277
function ( cell, val ) {
			var table = $(cell).parents('table');
			if ( DataTable.Api ) {
				// 1.10
				table.DataTable().cell( cell ).data( val );
			}
			else {
				// 1.9
				var dt = table.dataTable();
				var pos = dt.fnGetPosition( cell );
				dt.fnUpdate( val, pos[0], pos[2], false );
			}
		}
523717
function(cell) {
            if (cell.isColspan) {
                var colspan = parseInt(api.getAttribute(cell.el, 'colspan') || 1, 10),
                    cType = cell.el.tagName.toLowerCase();
                if (colspan > 1) {
                    var newCells = this.createCells(cType, colspan -1);
                    insertAfter(cell.el, newCells);
                }
                cell.el.removeAttribute('colspan');
            }
        }
653298
function stuffCellsIntoIncompleteRow(tableData, limitIndex) {
  tableData.forEach((rowData, rowIndex) => {
    const startIndex = rowData.length;
    if (startIndex) {
      const [{nodeName}] = rowData;

      util.range(startIndex, limitIndex).forEach(colIndex => {
        rowData.push(createBasicCell(rowIndex, colIndex, nodeName));
      });
    }
  });
}
810139
public Cell createTitleCell(String str, double width) {

        int cellCnt = this.getCellCnt();

        Cell cell = this.getLastRow().createCell(cellCnt);
        cell.setCellValue(str);
        cell.setCellType(CellType.STRING);
        cell.setCellStyle(this.style.getStringCs());

        sheet.setColumnWidth(cellCnt, (int) (sheet.getColumnWidth(cellCnt) * width));

        return cell;
    }
841734
def cell(*args)
      cell = TableCell.new(self, extract_selector(args).merge(:tag_name => /^(th|td)$/))
      cell.locator_class = ChildCellLocator

      cell
    end
996417
def _associate_data_cells_with_header_cells_of_row(self, element):
        

        table = self._get_model_table(element)
        for row in table:
            headers_ids = []
            for cell in row:
                if cell.get_tag_name() == 'TH':
                    self.id_generator.generate_id(cell)
                    headers_ids.append(cell.get_attribute('id'))

                    cell.set_attribute('scope', 'row')
            if bool(headers_ids):
                for cell in row:
                    if cell.get_tag_name() == 'TD':
                        headers = cell.get_attribute('headers')
                        for header_id in headers_ids:
                            headers = CommonFunctions.increase_in_list(
                                headers,
                                header_id
                            )
                        cell.set_attribute('headers', headers)
330515
function createCell(opts: Options, nodes?: Node[]): Block {
    return Block.create({
        type: opts.typeCell,
        nodes: nodes || [createEmptyContent(opts)]
    });
}
404873
static String retriveCellValue(Cell cell) {
        String cellValue = "";
        if (cell == null) {
            return cellValue;
        }
        try {
            switch (cell.getCellType()) {
                case Cell.CELL_TYPE_NUMERIC:
                    if (CellDateFormat.isDateCell(cell)) {
                        Date date = cell.getDateCellValue();
                        DateFormat dateFormat = CellDateFormat
                                .getFormat(cell.getCellStyle().getDataFormat()).getDateFormat();
                        cellValue = dateFormat.format(date);
                    } else {
                        cellValue = roundValue(cell.getNumericCellValue());
                    }
                    break;
                case Cell.CELL_TYPE_FORMULA:
                    cellValue = roundValue(cell.getSheet().getWorkbook().getCreationHelper()
                            .createFormulaEvaluator().evaluate(cell).formatAsString());
                    break;
                default:
                    cellValue = cell.getStringCellValue();
            }
        } catch (Exception e) {
            LOG.warn(MessageManager.getMessage("cell.fail"), cell.getRowIndex(),
                    cell.getColumnIndex(), e.getMessage());
        }

        return cellValue;
    }
396745
def write_rows #:nodoc:
      calculate_spans

      (@dim_rowmin .. @dim_rowmax).each do |row_num|
        # Skip row if it doesn't contain row formatting or cell data.
        next if not_contain_formatting_or_data?(row_num)

        span_index = row_num / 16
        span       = @row_spans[span_index]

        # Write the cells if the row contains data.
        if @cell_data_table[row_num]
          args = @set_rows[row_num] || []
          write_row_element(row_num, span, *args) do
            write_cell_column_dimension(row_num)
          end
        elsif @comments[row_num]
          write_empty_row(row_num, span, *(@set_rows[row_num]))
        else
          # Row attributes only.
          write_empty_row(row_num, span, *(@set_rows[row_num]))
        end
      end
    end
700491
function onTab(
    event: *,
    change: Change,
    editor: *,
    opts: Options
): void | Change {
    event.preventDefault();
    const { value } = change;
    const direction = event.shiftKey ? -1 : +1;

    // Create new row if needed
    const { startKey, selection } = value;
    const pos = TablePosition.create(opts, value.document, startKey);
    if (pos.isFirstCell() && direction === -1) {
        insertRow(opts, change, 0);
    } else if (pos.isLastCell() && direction === 1) {
        insertRow(opts, change);
    }

    // Move back to initial cell (insertRow moves selection automatically).
    change.select(selection);

    // Move
    moveSelectionBy(opts, change, direction, 0);

    // Select all cell.
    return selectAllText(change);
}
1276962
def write_table(page, headers, data, cl=''):

    

    page.table(class_=cl)

    # list
    if cl=='list':
        for i in range(len(headers)):

            page.tr()
            page.th()
            page.add('%s' % headers[i])
            page.th.close()
            page.td()
            page.add('%s' % data[i])
            page.td.close()
            page.tr.close()

    else:
        page.tr()
        for n in headers:
            page.th()
            page.add('%s' % n)
            page.th.close()
        page.tr.close()

        if data and not re.search('list',str(type(data[0]))):
            data = [data]

        for row in data:
            page.tr()
            for item in row:
                page.td()
                page.add('%s' % item)
                page.td.close()
            page.tr.close()

    page.table.close()

    return page
1205115
private Cell newCell(Row tmplRow, int cellCol, int rowOffset, Row row, Object cellValue, int maxLen) {
        val cell = getOrCreateCell(tmplRow, cellCol, rowOffset, row);

        val value = PoiUtil.writeCellValue(cell, cellValue);

        fixMaxRowHeightRatio(row, maxLen, value);
        return cell;
    }
231776
function addTbodyOrTheadIfNeed(tableData) {
  const [header] = tableData;
  const cellCount = header.length;
  let added = true;

  if (!cellCount && tableData[1]) {
    util.range(0, tableData[1].length).forEach(colIndex => {
      header.push(createBasicCell(0, colIndex, 'TH'));
    });
  } else if (tableData[0][0].nodeName !== 'TH') {
    const newHeader = util.range(0, cellCount).map(colIndex => createBasicCell(0, colIndex, 'TH'));

    [].concat(...tableData).forEach(cellData => {
      if (cellData.elementIndex) {
        cellData.elementIndex.rowIndex += 1;
      }
    });

    tableData.unshift(newHeader);
  } else if (tableData.length === 1) {
    const newRow = util.range(0, cellCount).map(colIndex => (
      createBasicCell(1, colIndex, 'TD')
    ));

    tableData.push(newRow);
  } else {
    added = false;
  }

  return added;
}
1049208
function createTableHtml(renderData) {
  const thead = [renderData[0]];
  const tbody = renderData.slice(1);
  const theadHtml = _createTheadOrTbodyHtml(thead, 'THEAD');
  const tbodyHtml = _createTheadOrTbodyHtml(tbody, 'TBODY');
  const className = renderData.className ? ` class="${renderData.className}"` : '';

  return `<table${className}>${theadHtml + tbodyHtml}</renderData>`;
}
1040204
def write_two_cell_anchor(*args)
      index, type, col_from, row_from, col_from_offset, row_from_offset,
      col_to, row_to, col_to_offset, row_to_offset, col_absolute, row_absolute,
      width, height, description, shape = args

      attributes      = []

      # Add attribute for images.
      attributes << [:editAs, 'oneCell'] if type == 2

      # Add attribute for shapes.
      attributes << [:editAs, shape.edit_as] if shape && shape.edit_as

      @writer.tag_elements('xdr:twoCellAnchor', attributes) do
        # Write the xdr:from element.
        write_from(col_from, row_from, col_from_offset, row_from_offset)
        # Write the xdr:to element.
        write_to(col_to, row_to, col_to_offset, row_to_offset)

        if type == 1
          # Graphic frame.

          # Write the xdr:graphicFrame element for charts.
          write_graphic_frame(index, description)
        elsif type == 2
          # Write the xdr:pic element.
          write_pic(index, col_absolute, row_absolute, width, height, description)
        else
          # Write the xdr:sp element for shapes.
          write_sp(index, col_absolute, row_absolute, width, height, shape)
        end

        # Write the xdr:clientData element.
        write_client_data
      end
    end
10788
function buildDayTable() {
		var html = buildDayTableHTML();

		if (dayTable) {
			dayTable.remove();
		}
		dayTable = $(html).appendTo(element);

		dayHead = dayTable.find('thead');
		dayHeadCells = dayHead.find('th').slice(1, -1); // exclude gutter
		dayBody = dayTable.find('tbody');
		dayBodyCells = dayBody.find('td').slice(0, -1); // exclude gutter
		dayBodyCellInners = dayBodyCells.find('> div');
		dayBodyCellContentInners = dayBodyCells.find('.fc-day-content > div');

		dayBodyFirstCell = dayBodyCells.eq(0);
		dayBodyFirstCellStretcher = dayBodyCellInners.eq(0);
		
		markFirstLast(dayHead.add(dayHead.find('tr')));
		markFirstLast(dayBody.add(dayBody.find('tr')));

		// TODO: now that we rebuild the cells every time, we should call dayRender
	}
702163
function insertTable(
    opts: Options,
    change: Change,
    columns?: number = 2,
    rows?: number = 2,
    getCellContent?: (column: number, row: number) => Node[]
): Change {
    const { value } = change;

    if (!value.selection.startKey) return change;

    // Create the table node
    const table = createTable(opts, columns, rows, getCellContent);

    return change.insertBlock(table);
}