using System.Collections.Generic; using System.Text; namespace Swift.web.Component.Tab { public class SwiftTab { public int NoOfTabPerRow { get; set; } public List TabList { get; set; } public string CreateTab() { var html = new StringBuilder(); var noOfRows = 1; var totalTabs = TabList.Count; if (totalTabs > NoOfTabPerRow) noOfRows = totalTabs / NoOfTabPerRow + 1; else NoOfTabPerRow = totalTabs; int j = 0; for (int i = 0; i < noOfRows; i++) { html.Append("
"); html.Append(""); html.Append("
"); //html.Append( // ""); //html.Append(""); //html.Append(""); //html.Append(""); //html.Append("
"); //html.Append("
    "); //int k = j; //j = 0; //if (totalTabs > NoOfTabPerRow && k != 0) // NoOfTabPerRow = totalTabs - k; //while (j < NoOfTabPerRow) //{ // var tabField = TabList[j + k]; // var _class = tabField.IsSelected ? "selected" : ""; // var refPage = tabField.RefPage == "" ? "#" : tabField.RefPage; // html.Append("
  • " + tabField.TabDesc + // "
  • "); // j++; //} //html.Append("
"); //html.Append("

"); } return html.ToString(); } } }