How can i set the (css) style of a cell in an `asp:DataGrid`?

---

What am i really trying to achieve? An `html` `table`, where i control the per-cell html content, and the per-row and per-cell css style:

```
<TABLE>
   <TR class="odd available">
      <TD class="holiday available hassub firstColumn">
          <P ...>...
      <TD class="blackout">
          <A href="...">...</A>
      <TD style="available">
          <SPAN ...>...</SPAN>
      <TD class="booked">
          <DIV ...>...</DIV>
      <TD class="orphan available">
          <DIV ...>...</DIV>
      <TD style="orphan booked checked">
          <SPAN ...>...</SPAN>
          <A href="...">...</A>
          <DIV ...>...</DIV>
   </TR>
   <TR class="blackout">
      <TD>34 points
      <TD><%# GetHtmlForCell() %>
   </TR>
</TABLE>

```

And it is accepted that [an `asp:Repeater` cannot work](https://stackoverflow.com/questions/9361729/create-a-html-table-with-an-asp-repeater) in this case.

i have HTML that i need to generate; and i just have to see if ASP.net can generate required html. i'm guessing not, since "WebForms" means you don't generate HTML.

Bonus Chatter
-------------

An `asp:DataGrid` control in ASP.net renders multiple cells. The formatting of each style can be adjusted by [setting various formatting properties](http://msdn.microsoft.com/en-us/library/1yef90x0.aspx), for example:

* [`BackColor`](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcellstyle.backcolor.aspx)
* [`ForeColor`](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcellstyle.forecolor.aspx)
* [`Font`](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcellstyle.font.aspx)

But there is no way to adjust the `Style` of a cell, e.g.

```
style="holiday blackout hassub"

```

Bonus Reading
-------------

Some unrelated bonus reading:

* [Change the style of cell within datagrid](http://forums.silverlight.net/t/42372.aspx/1)
* [MSDN: DataGridViewCellStyle Class](http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcellstyle.aspx)
* How to set the style of a cell in an asp:ListView?
* [Create a HTML table with an ASP repeater](https://stackoverflow.com/questions/9361729/create-a-html-table-with-an-asp-repeater)
* [How to create a three column table in ASP.Net Repeater](https://stackoverflow.com/questions/3442897/how-to-create-a-three-column-table-in-asp-net-repeater)
* [custom html code in a repeater](https://stackoverflow.com/questions/9366762/html-table-layout-when-binding-with-asp-net-c-sharp-repeater)
* [MSDN: Cell Styles in the Windows Forms DataGridView Control](http://msdn.microsoft.com/en-us/library/1yef90x0.aspx)