Q:

Create HTML file code behaind

I get some data from simple XLS file and i want to build a simple HTML file with simple table.
Something simple like this:

Any suggestions ?

A:

You could create a HTML file simply by using strings, if this is your table:
<table>
 <tr>
   <th>Company</th>
   <th>Contact</th>
   <th>Country</th>
 </tr>
 <tr>
   <td>Alfreds Futterkiste</td>
   <td>Maria Anders</td>
   <td>Germany</td>
 </tr>
 ...
</table>

You could write in C#:
public struct HTMLTable
{
    public string[] ColumnNames;
    public TableColumn[] ColumnValues;
    public HTMLTable(string[] columnNames, TableColumn[] columnValues)
    {
      ColumnNames = columnNames;
      ColumnValues = columnValues;
    }
}

public struct TableColumn
{
    public string[] Values;
    public TableColumn(string[] values)
    {
      Values = values;
    }
}

public static class HTMLTableGenerator
{
    public static string GenerateHTMLTable(HTMLTable Table)
    {
        StringBuilder Builder = new StringBuilder();
        Builder.Append("<table>\n <tr>\n");
        foreach (string ColumnName in Table.ColumnNames)
            Builder.Append("  <th>" + ColumnName + "</th>\n");
        Builder.Append(" </tr>\n");
        foreach (var Column in Table.ColumnValues)
        {
            Builder.Append(" <tr>\n");
            foreach (string value in Column.Values)
                Builder.Append("  <td>" + value + "</td>\n");
            Builder.Append(" </tr>\n");
        }
        Builder.Append("</table>");
        return Builder.ToString();
    }
}

I've written this directly on the answer and it's not the best aprroach, you should also make changes (to make columnvalues match, html indentation, maybe adding CSS).
EDIT: 
This is an expample of implementation:
    string[] Columns = new string[] { "Company", "Contact", "Country" };
    TableColumn FirstColumn = new TableColumn(new string[] { "Alfreds Futterkiste", "Maria Anders", "Germany" });
    TableColumn[] TableColumns = new TableColumn[] { FirstColumn };
    HTMLTable Table = new HTMLTable(Columns, TableColumns);      
    string HTMLString = HTMLTableGenerator.GenerateHTMLTable(Table);
    File.WriteAllText(@"C:\file.html", HTMLString);

This should create the first column row and save it to C:\file.html.
I just tested it, and it works properly.
EDIT2:
To add a link in html: <a href="url">Name</a>
To implement this you can change TableColumn to this:
public struct TableColumn
{   
 public Value[] Values;
 public TableColumn(Value[] values)
 {
   Values = values;
 }
}

And add this:
public struct Value
{
 public string Str;
 public bool IsURL;
 public Value(string str, bool isURL)
 {
  Str = str;
  isURL = IsURL;
 }
}

Then here:
foreach (string value in Column.Values)
       Builder.Append("  <td>" + value + "</td>\n");

Change it to: 
 foreach (Value value in Column.Values)
   {
    if(value.IsURL) 
       Builder.Append("  <td><a href=" + value.Str + ">" + value.Str.SubString(0, 10) + "...</a></td>);
    else Builder.Append("  <td>" + value.Str + "</td>");
   }

EDIT3: To add the CSS code, save that CSS into a file, and that file into the output folder (ie: Solution\Project\bin\Debug\style.css")
Then add this function to HTMLTableGenerator :
private string GetStyle()
  => File.ReadAllText(Application.Info.StartupPath + "\\style.css");

And add this line at the begining of GenerateHTMLTable() (After Builder is created):
Builder.Append(GetStyle());

