You could do the ASP.NET version very much the same way as you would with the PHP version by just using ASP.NET statements inline with your HTML. If this table is to be used on more than a single page, you should then consider moving the table HTML and logic into a "User Control" which can then be included on any page. User Controls can have properties and methods defined, just like any class, and if implemented could give you programmatic control over the rendering of the HTML.
The part of your article that concerns me is that you say you are building all of the HTML within a string in the header and then displaying it. That sounds like a horribly difficult way of doing it, no wonder you are having such a hard time with ASP.NET! While something like that may work, you are not taking advantage of any of ASP.NET's real features. You should probably take a step back, learn a bit more about the capabilities of ASP.NET and think about a structure that isn't so limited.
I'd start off by going here and learning more about User Controls and Data Binding, which is the technique I would suggest for your table situation. Keep in mind that data binding isn't limited to recordsets or database information, you can data bind to nearly any class property, enumerable or not.
http://www.asp.net/Tutorials/quickstart.aspx
I would also suggest you look at the source code of the sample sites they have, this should give you a better idea of "best practices" to use when programming sites with ASP.NET. http://www.asp.net/Default.aspx?tabindex=8&tabid=47
Good luck!