How to check for an HTML element in a rich text field?
You can get this to work if you first escape your string using Twig escape filter. Not exactly sure what's going on, but it'll only work for me if I make Twig double escape the string like so:

{% set strategy = 'html' %}
{% set doubleEscapedString = entry.richTextFieldHandle|escape(strategy) %}
{% set hasTable = '&amp;lt;/table&amp;gt;' in doubleEscapedString %}

&lt;div class="{{ hasTable ? 'hasTable' : 'hasNoTable' }}"&gt;
    {{ entry.richTextFieldHandle }}
&lt;/div&gt;