private static string SimpleGrid <T>(this HtmlHelper html, IEnumerable <T> listItems, IEnumerable <ColumnOption <T> > options, GridOption <T> gridOption, bool showHeader) { ContainerElement container = new ContainerElement(); container.Class("table-container"); if (gridOption != null && gridOption.Style != null) { container.Class("table-container").Style(gridOption.Style); } TagBuilder builder = new TagBuilder("table"); builder.AddCssClass("table-list maxwidth"); builder.MergeAttribute("border", "0"); builder.MergeAttribute("cellpadding", "0"); builder.MergeAttribute("cellspacing", "0"); if (showHeader) { builder.InnerHtml += BuildListDataHeader <T>(html, options, gridOption); } if (listItems != null && listItems.Count() > 0) { bool isAltRow = false; foreach (var item in listItems) { builder.InnerHtml += BuildListDataRow(html, item, options, isAltRow, gridOption); isAltRow = !isAltRow; } } else if (gridOption == null || gridOption.Style == null || !gridOption.Style.Contains(HtmlStyleAttribute.Height)) { builder.InnerHtml += BuildListEmptyDataRow(html, options); } container.InnerElement(new TextElement().InnerText(builder.ToString())); return(container.ToString()); }