emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mike Gauland <mikelygee@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Indentation in html tables
Date: Sat, 17 Jul 2010 02:20:04 +0000 (UTC)	[thread overview]
Message-ID: <loom.20100717T035110-168@post.gmane.org> (raw)

 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	other threads:[~2010-07-17  2:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20100717T035110-168@post.gmane.org \
    --to=mikelygee@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).