def iter_dicts_table(iter_dicts, classes=None, check=False):
    """Convert an iterable sequence of dictionaries (all of which with
    identical keys) to an HTML table.

    Args:
      iter_dicts (iter): an iterable sequence (list, tuple) of
        dictionaries, dictionaries having identical keys.
      classes (str): Is the substitute for <table class="%s">.
      check (bool): check for key consistency!

    Returns:
      str|None: HTML tabular representation of a Python iterable sequence of
        dictionaries which share identical keys. Returns None if table
        is not consistent (dictionary keys).

    """

    # check key consistency
    if check:
        first_keys = iter_dicts[0].keys()

        for d in iter_dicts:

            if d.keys() != first_keys:

                return None

    table_parts = {}
    table_parts['classes'] = ' class="%s"' % classes if classes else ''
    table_parts['thead'] = ''.join(['<th>%s</th>' % k for k in iter_dicts[0]])

    # tbody
    keys = ['<td>%(' + key + ')s</td>' for key in iter_dicts[0]]
    row = '<tr>' + ''.join(keys) + '</tr>'
    table_parts['tbody'] = '\n'.join([row % d for d in iter_dicts])

    return '''
           <table{classes}>
             <thead>
               <tr>{thead}</tr>
             </thead>
             <tbody>
               {tbody}
             </tbody>
           </table>
           '''.format(**table_parts)