Function: org-export-table-has-header-p

org-export-table-has-header-p is a byte-compiled function defined in ox.el.gz.

Signature

(org-export-table-has-header-p TABLE INFO)

Documentation

Non-nil when TABLE has a header.

INFO is a plist used as a communication channel.

A table has a header when it contains at least two row groups.

Source Code

;; Defined in /usr/src/emacs/lisp/org/ox.el.gz
(defun org-export-table-has-header-p (table info)
  "Non-nil when TABLE has a header.

INFO is a plist used as a communication channel.

A table has a header when it contains at least two row groups."
  (let* ((cache (or (plist-get info :table-header-cache)
		    (let ((table (make-hash-table :test #'eq)))
		      (plist-put info :table-header-cache table)
		      table)))
	 (cached (gethash table cache 'no-cache)))
    (if (not (eq cached 'no-cache)) cached
      (let ((rowgroup 1) row-flag)
	(puthash table
		 (org-element-map table 'table-row
		   (lambda (row)
		     (cond
		      ((> rowgroup 1) t)
		      ((and row-flag
			    (eq (org-element-property :type row) 'rule))
		       (cl-incf rowgroup)
		       (setq row-flag nil))
		      ((and (not row-flag)
			    (eq (org-element-property :type row) 'standard))
		       (setq row-flag t)
		       nil)))
		   info 'first-match)
		 cache)))))