emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Indentation in html tables


From: Mike Gauland
Subject: [Orgmode] Indentation in html tables
Date: Sat, 17 Jul 2010 02:20:04 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

 I frequently use a columnview dynamic block to create a table (generally a task
list, with effort estimates and notes). I export these to HTML, so they look
pretty for my Emacsphobic colleagues.  I've noticed that when my table includes
nested levels, sometimes the level is indicated in the HTML with *'s, and other
times a <span> of invisible x's is used instead.  I haven't had any luck trying
to figure out why this happens, or what I'm doing differently to get one or the
other. Can anyone explain this?

I prefer to use padding for indentation, since some of my headings get wrapped
to several lines. Padding prevents the second and subsequent lines from starting
at the left edge, making the structure of the table clearer.  For those who
share this preference, I present the following from my .emacs. When exporting a
table to HTML, it replaces invisible x's with *'s, and converts *'s to a padding
directive:

(add-hook 'org-export-html-final-hook
          (lambda ()
            (goto-char (point-min))
            (while (re-search-forward "<td>\\(\\*+\\) " nil t)
              (replace-match 
               (format "<td style=\"padding-left:%dem\">"
                       (- (length (match-string 1)) 1)))
              )))
(add-hook 'org-export-html-final-hook
          (lambda () 
            (goto-char (point-min))
            (while (re-search-forward "<span
style=\"visibility:hidden;\">\\(\\x+\\)</span>" nil t)
              (replace-match (concat (make-string (length (match-string 1)) ?*)
" "))
              )))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]