If I add the following slide into the default presentation provided by reveal.js, then the table is not centred.

  <section>
  <p>This is centred</p>

  <table>
    <tr>
      <td>This</td>
      <td>is</td>
      <td>not</td>
    </tr>
  </table>
  </section>

enter image description here

I can fix it by adding in padding, but this then becomes dependent on the screen size, and I am worried that when I go to present the screen will be a different size. There must be a better way?

有帮助吗?

解决方案

According to this and my testing, if you add the reveal class to your table, the newest reveal.js should center it.

  <section>
  <p>This is centred</p>

  <table class="reveal">
    <tr>
      <td>This</td>
      <td>is</td>
      <td>not</td>
    </tr>
  </table>
  </section>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top