Browse Source

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 4 years ago
parent
commit
25e1e4d0eb
1 changed files with 11 additions and 7 deletions
  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"