public static HtmlBuilder Report(Category category, Library helpLib) { HtmlBuilder report = Report(category.Details); List<Puzzle> puz = category.GetPuzzles(); report.AddLabel("Puzzles", puz.Count.ToString()); int puzPerLine = 4; int counter = 1; report.AddLine("<table class=\"tableformat\"><tr><td>"); foreach (Puzzle puzzle in puz) { report.Add(puzzle.Details.Name); report.Add("<br/>"); report.Add("<a href=\"app://puzzle/{0}\">", puzzle.PuzzleID); report.Add(puzzle.MasterMap, DrawingHelper.DrawPuzzle(puzzle.MasterMap), "width:100px; height:80px"); report.Add("</a>"); if (counter % puzPerLine == 0) { // Row break report.AddLine("</td></tr><tr><td>"); } else { // Next cell report.AddLine("</td><td>"); } counter++; } report.AddLine("</td></tr></table>"); return report; }