Reveal.js 表和div元素未在leaver.js中居中

Reveal.js 表和div元素未在leaver.js中居中,reveal.js,Reveal.js,如果我将下面的幻灯片添加到由reveal.js提供的默认演示文稿中,则该表不会居中 <section> <p>This is centred</p> <table> <tr> <td>This</td> <td>is</td> <td>not</td> </tr> </table

如果我将下面的幻灯片添加到由reveal.js提供的默认演示文稿中,则该表不会居中

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

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

这是中心的

这 是 不

我可以通过添加填充来修复它,但这取决于屏幕大小,我担心当我去展示屏幕时,屏幕会是不同的大小。一定有更好的方法吗?

根据和我的测试,如果您将
reveal
类添加到表中,最新的reveal.js应该将其居中

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

  <table class="reveal">
    <tr>
      <td>This</td>
      <td>is</td>
      <td>not</td>
    </tr>
  </table>
  </section>

这是中心的

这 是 不
我不确定这是否是最好的解决方案,.reveal类带来了许多其他的积垢,您可能不希望这些积垢出现在桌子上。最后,我编辑了CSS样式表(reveal.CSS),添加了
表{margin left:auto;margin right:auto;}
cruft是它的一部分,@Ketil。也就是说,您的解决方案适用于居中,但很脆弱,换句话说,如果leaver.js开始使用超级有趣的元居中超维样式,您将错过。在我看来,编辑图书馆也不是一个好主意。