emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Indentation in html tables
@ 2010-07-17  2:20 Mike Gauland
  0 siblings, 0 replies; only message in thread
From: Mike Gauland @ 2010-07-17  2:20 UTC (permalink / raw)
  To: emacs-orgmode

 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)) ?*)
" "))
              )))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-17  2:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-17  2:20 Indentation in html tables Mike Gauland

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).