0

I can use below code to change font size to 60%, how can I make it take effect for all tables?

#+REVEAL_HTML: <div style="font-size: 60%;">
| Name                     | Blueprint        |
| LOCAL_PRODUCT_MODULE     | product_specific |
| LOCAL_PROPRIETARY_MODULE | vendor_specific  |
| LOCAL_ODM_MODULE         | device_specific  |
#+REVEAL_HTML: </div>
2

You can use this code to declare a style that will change table formatting globally:

#+begin_export html
<style>
.reveal  td {font-size: 60%;}
</style>
#+end_export

Of course you can style th the same way if needed.

4
  • Thanks, it works fine. BTW, is REVEAL_HTML and begin_export html the same thing? – lucky1928 Jan 12 at 16:24
  • No: #+REVEAL_HTML is used only by ox-reveal.el (an exporter derived from the Org mode HTML exporter); #+begin_export html is recognized by the generic Org mode parser in org-element.el. – NickD Jan 12 at 16:47
  • What the answer says is: when exporting to HTML (through either the basic HTML exporter or one derived from it - e.g. ox-reveal.el -, add the <style>...</style> section to the HTML file that is produced. Any effect of the style has to do with the fact that the ox-reveal exporter exports the body as a <div class="reveal">, so any <td> element under it matches the CSS rule and gets the specified font size. – NickD Jan 12 at 16:58
  • 1
    @NickD Thanks for these very clear explanations. My answer was based on an empirical approach (trials / errors) and it is really useful to have a deeper understanding. – Lgen Jan 13 at 10:25

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.