Return a newly added ``<p:graphicFrame>`` element containing a table
        as specified by the parameters.
9406
def _add_graphicFrame_containing_table(self, rows, cols, x, y, cx, cy):
        
        _id = self._next_shape_id
        name = 'Table %d' % (_id-1)
        graphicFrame = self._spTree.add_table(
            _id, name, rows, cols, x, y, cx, cy
        )
        return graphicFrame
1229240
def append(self, png, **options):
		
		if not isinstance(png, PNG):
			raise TypeError("Expect an instance of `PNG` but got `{}`".format(png))
		control = FrameControl(**options)
		if control.width is None:
			control.width = png.width
		if control.height is None:
			control.height = png.height
		self.frames.append((png, control))
888967
def convert_table_wrap_elements(self):
        
        for table_wrap in self.main.getroot().findall('.//table-wrap'):

            table_div = etree.Element('div', {'id': table_wrap.attrib['id']})

            label = table_wrap.find('label')
            caption = table_wrap.find('caption')
            alternatives = table_wrap.find('alternatives')
            graphic = table_wrap.find('graphic')
            table = table_wrap.find('table')
            if graphic is None:
                if alternatives is not None:
                    graphic = alternatives.find('graphic')
            if table is None:
                if alternatives is not None:
                    table = alternatives.find('table')

            #Handling the label and caption
            if label is not None and caption is not None:
                caption_div = etree.Element('div', {'class': 'table-caption'})
                caption_div_b = etree.SubElement(caption_div, 'b')
                if label is not None:
                    append_all_below(caption_div_b, label)
                if caption is not None:
                    #Find, optional, title element and paragraph elements
                    caption_title = caption.find('title')
                    if caption_title is not None:
                        append_all_below(caption_div_b, caption_title)
                    caption_ps = caption.findall('p')
                    #For title and each paragraph, give children to the div
                    for caption_p in caption_ps:
                        append_all_below(caption_div, caption_p)
                #Add this to the table div
                table_div.append(caption_div)

            ### Practical Description ###
            #A table may have both, one of, or neither of graphic and table
            #The different combinations should be handled, but a table-wrap
            #with neither should fail with an error
            #
            #If there is both an image and a table, the image should be placed
            #in the text flow with a link to the html table
            #
            #If there is an image and no table, the image should be placed in
            #the text flow without a link to an html table
            #
            #If there is a table with no image, then the table should be placed
            #in the text flow.

            if graphic is not None:
                #Create the image path for the graphic
                xlink_href = ns_format(graphic, 'xlink:href')
                graphic_xlink_href = graphic.attrib[xlink_href]
                file_name = graphic_xlink_href.split('.')[-1] + '.png'
                img_dir = 'images-' + self.doi_suffix()
                img_path = '/'.join([img_dir, file_name])
                #Create the new img element
                img_element = etree.Element('img', {'alt': 'A Table',
                                                    'src': img_path,
                                                    'class': 'table'})
                #Add this to the table div
                table_div.append(img_element)
                #If table, add it to the list, and link to it
                if table is not None:  # Both graphic and table
                    #The label attribute is just a means of transmitting some
                    #plaintext which will be used for the labeling in the html
                    #tables file
                    div = etree.SubElement(self.tables.find('body'),
                                           'div',
                                           {'id': table_wrap.attrib['id']})

                    if label is not None:
                        bold_label = etree.SubElement(div, 'b')
                        append_all_below(bold_label, label)
                    #Add the table to the tables list
                    div.append(deepcopy(table))
                    #Also add the table's foot if it exists
                    table_wrap_foot = table_wrap.find('table-wrap-foot')
                    if table_wrap_foot is not None:
                        table_wrap_foot.tag = 'div'
                        table_wrap_foot.attrib['class'] = 'table-wrap-foot'
                        div.append(table_wrap_foot)
                    #Create a link to the html version of the table
                    html_table_link = etree.Element('a')
                    html_table_link.attrib['href'] = self.tables_fragment.format(table_wrap.attrib['id'])
                    html_table_link.text = 'Go to HTML version of this table'
                    #Add this to the table div
                    table_div.append(html_table_link)
                    remove(table)

            elif table is not None:  # Table only
                #Simply append the table to the table div
                table_div.append(table)
            elif graphic is None and table is None:
                sys.exit('Encountered table-wrap element with neither graphic nor table. Exiting.')

            #Replace the original table-wrap with the newly constructed div
            replace(table_wrap, table_div)
119320
private void importTable(Table table) {
        this.rows = new ArrayList();
        this.tableWidthPercent = table.getWidth();
        this.proportionalWidths = table.getProportionalWidths();
        this.cellPadding = (float) (table.getPadding() * TWIPS_FACTOR);
        this.cellSpacing = (float) (table.getSpacing() * TWIPS_FACTOR);
        this.borders = new RtfBorderGroup(this.document, RtfBorder.ROW_BORDER, table.getBorder(), table.getBorderWidth(), table.getBorderColor());
        this.alignment = table.getAlignment();
        
        int i = 0;
        Iterator rowIterator = table.iterator();
        while(rowIterator.hasNext()) {
            this.rows.add(new RtfRow(this.document, this, (Row) rowIterator.next(), i));
            i++;
        }
        for(i = 0; i < this.rows.size(); i++) {
            ((RtfRow) this.rows.get(i)).handleCellSpanning();
            ((RtfRow) this.rows.get(i)).cleanRow();
        }
        this.headerRows = table.getLastHeaderRow();
        this.cellsFitToPage = table.isCellsFitPage();
        this.tableFitToPage = table.isTableFitsPage();
        if(!Float.isNaN(table.getOffset())) {
            this.offset = (int) (table.getOffset() * 2);
        }
    }
1333783
def new_graphicFrame(cls, id_, name, x, y, cx, cy):
        
        xml = cls._graphicFrame_tmpl() % (id_, name, x, y, cx, cy)
        graphicFrame = parse_xml(xml)
        return graphicFrame
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);
}
180073
def add_table(ref, options={})
      tables << Table.new(ref, self, options)
      yield tables.last if block_given?
      tables.last
    end
263497
private JTable getTableExtension() {
		if (tableExt == null) {
			tableExt = new JTable();
			tableExt.setModel(this.model);
			tableExt.getColumnModel().getColumn(0).setPreferredWidth(30);
			tableExt.getColumnModel().getColumn(1).setPreferredWidth(320);
			tableExt.getColumnModel().getColumn(2).setPreferredWidth(50);
			// Issue 954: Force the JTable cell to auto-save when the focus changes.
			// Example, edit cell, click OK for a panel dialog box, the data will get saved.
			tableExt.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);

			// Disable for now - would be useful but had some problems with this ;)
			/*
			ListSelectionListener sl = new ListSelectionListener() {

				@Override
				public void valueChanged(ListSelectionEvent arg0) {
	        		if (tableExt.getSelectedRow() > -1) {
	        			Context ctx = ((ContextListTableModel)tableExt.getModel()).getContext(
	        					tableExt.getSelectedRow());
	        			if (ctx != null) {
	        				try {
								extName.setText(ext.getName());
								extDescription.setText(ext.getDescription());
								if (ext.getAuthor() != null) {
									extAuthor.setText(ext.getAuthor());
								} else {
									extAuthor.setText("");
								}
								if (ext.getURL() != null) {
									extURL.setText(ext.getURL().toString());
									getUrlLaunchButton().setEnabled(true);
								} else {
									extURL.setText("");
									getUrlLaunchButton().setEnabled(false);
								}
							} catch (Exception e) {
								// Just to be safe
								log.error(e.getMessage(), e);
							}
	        			}
	        		}
				}};
			
			tableExt.getSelectionModel().addListSelectionListener(sl);
			tableExt.getColumnModel().getSelectionModel().addListSelectionListener(sl);
			*/
			
		}
		return tableExt;
	}
1185239
def prepend(self, frame_p):
        
        return lib.zmsg_prepend(self._as_parameter_, byref(zframe_p.from_param(frame_p)))
633905
public SQLSelect addColumnPart(final Integer _tableIndex,
                                   final String _columnName)
    {
        parts.add(new Column(tablePrefix, _tableIndex, _columnName));
        return this;
    }
108800
def append_fresh_table(self, fresh_table):
        
        if fresh_table.name:
            elements = []
            if fresh_table.is_array:
                elements += [element_factory.create_array_of_tables_header_element(fresh_table.name)]
            else:
                elements += [element_factory.create_table_header_element(fresh_table.name)]

            elements += [fresh_table, element_factory.create_newline_element()]
            self.append_elements(elements)

        else:
            # It's an anonymous table
            self.prepend_elements([fresh_table, element_factory.create_newline_element()])
836576
def _new_chart_graphicFrame(self, rId, x, y, cx, cy):
        
        id_, name = self.shape_id, self.name
        return CT_GraphicalObjectFrame.new_chart_graphicFrame(
            id_, name, rId, x, y, cx, cy
        )
301685
function(table) {
    var rows = 0;
    var columns = 0;
    var trs = table.getElementsByTagName("tr");
    for (var i = 0; i < trs.length; i++) {
      var rowspan = trs[i].getAttribute("rowspan") || 0;
      if (rowspan) {
        rowspan = parseInt(rowspan, 10);
      }
      rows += (rowspan || 1);

      // Now look for column-related info
      var columnsInThisRow = 0;
      var cells = trs[i].getElementsByTagName("td");
      for (var j = 0; j < cells.length; j++) {
        var colspan = cells[j].getAttribute("colspan") || 0;
        if (colspan) {
          colspan = parseInt(colspan, 10);
        }
        columnsInThisRow += (colspan || 1);
      }
      columns = Math.max(columns, columnsInThisRow);
    }
    return {rows: rows, columns: columns};
  }
493973
def notify_width_changed(self):
        
        new_table_width = sum([col.width for col in self.columns])
        self._graphic_frame.width = new_table_width
616369
function (params) {
        return new hitagi.Entity()
            .attach(new hitagi.components.graphics.Graphic({
                anchor: {
                    x: 0,
                    y: 0
                },
                relative: false,
                z: -1000
            }))
            .attach(new hitagi.components.graphics.Rectangle({
                color: params.color,
                height: levelHeight,
                width: levelWidth
            }));
    }
254971
function getTableItemByIndex(table, index) {
      if (table.isPanel) {
        table = table.getView();
      }
      var el = table.getRow(index);
      return el;
    }
469869
def TableSimulation():
    
    sg.SetOptions(element_padding=(0,0))

    menu_def = [['File', ['Open', 'Save', 'Exit']],
                ['Edit', ['Paste', ['Special', 'Normal',], 'Undo'],],
                ['Help', 'About...'],]

    columm_layout = [[]]

    MAX_ROWS = 20
    MAX_COL = 10
    for i in range(MAX_ROWS):
        inputs = [sg.T('{}'.format(i), size=(4,1), justification='right')] + [sg.In(size=(10, 1), pad=(1, 1), justification='right', key=(i,j), do_not_clear=True) for j in range(MAX_COL)]
        columm_layout.append(inputs)

    layout = [ [sg.Menu(menu_def)],
               [sg.T('Table Using Combos and Input Elements', font='Any 18')],
               [sg.T('Type in a row, column and value. The form will update the values in realtime as you type'),
               sg.In(key='inputrow', justification='right', size=(8,1), pad=(1,1), do_not_clear=True),
               sg.In(key='inputcol', size=(8,1), pad=(1,1), justification='right', do_not_clear=True),
               sg.In(key='value', size=(8,1), pad=(1,1), justification='right', do_not_clear=True)],
               [sg.Column(columm_layout, size=(800,600), scrollable=True)] ]

    window = sg.Window('Table', return_keyboard_events=True).Layout(layout)

    while True:
        event, values = window.Read()
        # --- Process buttons --- #
        if event is None or event == 'Exit':
            break
        elif event == 'About...':
            sg.Popup('Demo of table capabilities')
        elif event == 'Open':
            filename = sg.PopupGetFile('filename to open', no_window=True, file_types=(("CSV Files","*.csv"),))
            # --- populate table with file contents --- #
            if filename is not None:
                with open(filename, "r") as infile:
                    reader = csv.reader(infile)
                    try:
                        data = list(reader)  # read everything else into a list of rows
                    except:
                        sg.PopupError('Error reading file')
                        continue
                # clear the table
                [window.FindElement((i,j)).Update('') for j in range(MAX_COL) for i in range(MAX_ROWS)]

                for i, row in enumerate(data):
                    for j, item in enumerate(row):
                        location = (i,j)
                        try:            # try the best we can at reading and filling the table
                            target_element = window.FindElement(location)
                            new_value = item
                            if target_element is not None and new_value != '':
                                target_element.Update(new_value)
                        except:
                            pass

        # if a valid table location entered, change that location's value
        try:
            location = (int(values['inputrow']), int(values['inputcol']))
            target_element = window.FindElement(location)
            new_value = values['value']
            if target_element is not None and new_value != '':
                target_element.Update(new_value)
        except:
            pass