def read_csv_to_html_table(csvFile, hasHeader='N'):
    """
    reads a CSV file and converts it to HTML
    """
    txt = '<table class="as-table as-table-zebra as-table-horizontal">'
    with open(csvFile, 'r') as f:
        numRows = 1
        for row in f:
            if hasHeader == 'Y':
                if numRows == 1:
                    td_begin = '<TH>'
                    td_end = '</TH>'
                else:
                    td_begin = '<TD>'
                    td_end = '</TD>'
            else:
                td_begin = '<TD>'
                td_end = '</TD>'
            cols = row.split(',')
            numRows += 1
            txt += '<TR>'
            for col in cols:
                txt += td_begin
                try:
                    colString = col
                except Exception:
                    colString = (
                        '<font color=red>Error decoding column data</font>')
                txt += colString.strip('"')
                txt += td_end
            txt += '</TR>\n'
        txt += '</TABLE>\n\n'
    return txt
