Style and script tags not working within textfield

When trying to use <style>...</style> or <script>...</script> within a field, the content of their content gets deleted as soon as I close the html editor.
For example trying to use the following to get a table with horizontal separators:

<style>
  table {
    border-collapse: collapse;
    border: none;
  }
  tr {
    border-top: 1px solid black;
  }
  tr:first-child {
    border-top: none;
  }
  td {
    border: none !important;
  }
</style>
<table>
<tbody>
  <tr>
    <td>content 1</td>
  </tr>
  <tr>
    <td>content 2</td>
  </tr>
</tbody>
</table>

, it simply gets turned into

<table>
<tbody>
  <tr>
    <td>content 1</td>
  </tr>
  <tr>
    <td>content 2</td>
  </tr>
</tbody>
</table>

as soon as the HTML editor is closed. I have tried disabling every addon and then restarting Anki, and it still doesn’t work. Am using Anki 2.1.49.

1 Like