瀏覽代碼

ox-html.el (org-html-table-row-tags): Better example

* ox-html.el (org-html-table-row-tags): Better example.

Thanks to Stefan Vollmar for providing this new example.
Bastien Guerry 12 年之前
父節點
當前提交
25e1e4d0eb
共有 1 個文件被更改,包括 11 次插入7 次删除
  1. 11 7
      lisp/ox-html.el

+ 11 - 7
lisp/ox-html.el

@@ -795,13 +795,17 @@ you can reuse them:
 
 For example:
 
-  (setq org-html-table-row-tags
-        (cons '(cond (top-row-p \"<tr class=\\\"tr-top\\\">\")
-                     (bottom-row-p \"<tr class=\\\"tr-bottom\\\">\")
-                     (t \"<tr>\"))
-              \"</tr>\"))
-
-will use the \"tr-top\" and \"tr-bottom\" classes for top and bottom row."
+\(setq org-html-table-row-tags
+      (cons '(cond (top-row-p \"<tr class=\\\"tr-top\\\">\")
+                   (bottom-row-p \"<tr class=\\\"tr-bottom\\\">\")
+                   (t (if (= (mod row-number 2) 1)
+			  \"<tr class=\\\"tr-odd\\\">\"
+			\"<tr class=\\\"tr-even\\\">\")))
+	    \"</tr>\"))
+
+will use the \"tr-top\" and \"tr-bottom\" classes for the top row
+and the bottom row, and otherwise alternate between \"tr-odd\" and
+\"tr-even\" for odd and even rows."
   :group 'org-export-html
   :type '(cons
 	  (choice :tag "Opening tag"