forked from mirrors/org-mode
Fix table alignment for the docbook exporter
* lisp/org-html.el (org-format-table-html): New argument DOCBOOK. (org-format-org-table-html): New argument DOCBOOK. When set, use align instead of class to align table fields. * lisp/org-docbook.el (org-export-as-docbook): Specify the docbook argument for the table converter.
This commit is contained in:
parent
23812f9cf1
commit
25d365a373
|
@ -1005,7 +1005,8 @@ publishing directory."
|
|||
table-orig-buffer (nreverse table-orig-buffer))
|
||||
(org-export-docbook-close-para-maybe)
|
||||
(insert (org-export-docbook-finalize-table
|
||||
(org-format-table-html table-buffer table-orig-buffer)))))
|
||||
(org-format-table-html table-buffer table-orig-buffer
|
||||
'docbook)))))
|
||||
|
||||
(t
|
||||
;; Normal lines
|
||||
|
|
|
@ -1838,13 +1838,13 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
nil))))
|
||||
|
||||
(defvar org-table-number-regexp) ; defined in org-table.el
|
||||
(defun org-format-table-html (lines olines)
|
||||
(defun org-format-table-html (lines olines &optional docbook)
|
||||
"Find out which HTML converter to use and return the HTML code."
|
||||
(if (stringp lines)
|
||||
(setq lines (org-split-string lines "\n")))
|
||||
(if (string-match "^[ \t]*|" (car lines))
|
||||
;; A normal org table
|
||||
(org-format-org-table-html lines)
|
||||
(org-format-org-table-html lines nil docbook)
|
||||
;; Table made by table.el - test for spanning
|
||||
(let* ((hlines (delq nil (mapcar
|
||||
(lambda (x)
|
||||
|
@ -1865,7 +1865,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(org-format-table-table-html-using-table-generate-source olines)))))
|
||||
|
||||
(defvar org-table-number-fraction) ; defined in org-table.el
|
||||
(defun org-format-org-table-html (lines &optional splice)
|
||||
(defun org-format-org-table-html (lines &optional splice docbook)
|
||||
"Format a table into HTML."
|
||||
(require 'org-table)
|
||||
;; Get rid of hlines at beginning and end
|
||||
|
@ -1997,7 +1997,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(if (not org-export-html-table-align-individual-fields)
|
||||
""
|
||||
(setq n (string-to-number (match-string 1 txt)))
|
||||
(format " class=\"%s\""
|
||||
(format (if docbook " align=\"%s\"" " class=\"%s\"")
|
||||
(or (nth n aligns) "left"))))
|
||||
x))
|
||||
html))
|
||||
|
|
Loading…
Reference in New Issue