Ejemplo n.º 1
0
        public static string GenerateBlockHTMLTable(Block[] blocks)
        {
            string pre = "<table border='1'>" +
                         "<tr><th>ID</th>" +
                         "<th>Name</th>" +
                         "<th>Item drop:</th>" +
                         "<th>Num drop: </th></tr>";
            string end = "</table>";
            string mid = "";
            Array.Sort(blocks, (x, y) => x.ID - y.ID);

            foreach (Block b in blocks)
            {
                if (b.ID == 0) continue;
                mid += "<tr><td>" +
                       b.ID +
                       "</td><td>" +
                       b.Name +
                       "</td><td>" +
                       b.ItemDrop +
                       "</td><td>" +
                       b.ItemDropNum +
                       "</td></tr>";
            }

            return pre + mid + end;
        }