Edit in JSFiddle

$("[id$=myButtonControlID]").click(function(e) {
    window.open('data:application/vnd.ms-excel,' + encodeURIComponent( $('div[id$=divTableDataHolder]').html()));
    e.preventDefault();
});
<button id="myButtonControlID">Export Table data into Excel</button>
<div id="divTableDataHolder">
<table>
    <tr><th>ColumnOne </th><th>ColumnTwo</th></tr>
<tr>
<td>row1ColValue1</td><td>row1ColValue2</td>
</tr>
<tr>
<td>row2ColValue1</td><td>row2ColValue2</td>
</tr>
</table>
</div>
table
{
    border: 1px solid black;    
}
th
{
    border: 1px solid black;
    padding: 5px;
    background-color:skyblue;
    color: white;  
}
td
{
    border: 1px solid black;
    padding: 5px;
    color: green;
}