1. You are opening 2 table tags here.
2. variable index will always be 1. Not sure why do you have it.
Will something like this help you (not tested at all):
html.Append("<table style=\"border-style:solid\">");
int fieldCount = reader.FieldCount;
html.Append("<thead>");
for (int index = 0; index < fieldCount; index++)
{
html.Append("<th>" + reader.GetName(index) + "</th>");
}
html.Append("</thead><tbody>");
while (reader.Read())
{
html.Append("<tr>");
for (int index = 0; index < fieldCount; index++)
{
html.Append("<td>" + reader[index].ToString() + "</td>");
}
html.Append("</tr>");
}
html.Append("</tbody></table>");