9

I would like to set the class for a table in html export, e.g.: <table class="table table-striped">

While it seems that setting some attributes for export of tables to HTML are possible: #+ATTR_HTML: :border 2 :rules all :frame border I could not find any documentation on setting the class. Is this possible?

8

You can treat the class attribute the same as other attributes and just set it:

#+ATTR_HTML: :border 2 :rules all :frame border :class striped table-striped

Which yielded (adding a newline for clarity):

<table border="2" cellspacing="0" cellpadding="6" rules="all" 
 frame="border" class="striped table-striped">
|improve this answer|||||
  • Thanks. Class was not among the set attributes so I did not think to try it. – user1031565 Jan 3 '15 at 3:52
  • Can I use this with standard org-mode tables? #+CAPTION: title | column A | column B | |----------+----------| | foo | bar | |----------+----------| – incandescentman May 18 '17 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.