Function: org-export-table-dimensions

org-export-table-dimensions is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-table-dimensions TABLE INFO)

Documentation

Return TABLE dimensions.

INFO is a plist used as a communication channel.

Return value is a CONS like (ROWS . COLUMNS) where ROWS (resp. COLUMNS) is the number of exportable rows (resp. columns).

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-table-dimensions (table info)
  "Return TABLE dimensions.

INFO is a plist used as a communication channel.

Return value is a CONS like (ROWS . COLUMNS) where
ROWS (resp. COLUMNS) is the number of exportable
rows (resp. columns)."
  (let (first-row (columns 0) (rows 0))
    ;; Set number of rows, and extract first one.
    (org-element-map table 'table-row
      (lambda (row)
	(when (eq (org-element-property :type row) 'standard)
	  (cl-incf rows)
	  (unless first-row (setq first-row row))))
      info)
    ;; Set number of columns.
    (org-element-map first-row 'table-cell (lambda (_) (cl-incf columns)) info)
    ;; Return value.
    (cons rows columns)))