diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-25 15:40:30 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-10-25 15:40:30 +0200 |
commit | 25d365a37346a408c1b72fc90f4d06f2c0a1b0e1 (patch) | |
tree | 16244281c22473479090916909748a9b6ca44863 | |
parent | 23812f9cf172cbbb0feb06070ed3c22775858794 (diff) | |
download | org-mode-25d365a37346a408c1b72fc90f4d06f2c0a1b0e1.tar.gz |
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.
-rw-r--r-- | lisp/org-docbook.el | 3 | ||||
-rw-r--r-- | lisp/org-html.el | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index d4668cb..a087edb 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -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 diff --git a/lisp/org-html.el b/lisp/org-html.el index 27709f1..f4b1f17 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -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)) |