def html_table(table, cellspacing="10", style='"width:500px"'):
    """
    Creates a html code to a table

    :param table: A list of rows of list of cells(text )
    :param style: Html style for the table:  e.g "width:300px" (default )
    :return:  html code to the table


    e.g:  print html_table( [['hello', 'world', 'haaa'], ['test', 'test4', 'cx854']])

    <table style="width:300px">
    <tr>
	    <td>hello</td>
	    <td>world</td>
	    <td>haaa</td>
    <tr>
    <tr>
	    <td>test</td>
	    <td>test4</td>
	    <td>cx854</td>

    <tr>

    </table>
    """

    txt_ = ""
    for row in table:
        txt = ""

        for cell in row:
            txt = "".join([txt, '\t<td>', cell, '</td>\n'])

        # print txt
        txt_ = "".join([txt_, '<tr>\n', txt, '\n<tr>\n'])

    # return "".join( [ "<table style=", style, '>\n', txt_, '\n</table>' ])

    return "".join(['<table cellspacing="', str(cellspacing), '" >\n', txt_, '\n</table>'])