//// This code is part of Document Solutions for Word demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingSystem;usingGrapeCity.Documents.Word; namespaceDsWordWeb.Demos{// Demo of all built-in table stylespublicclassBuiltInTableStyles {publicGcWordDocumentCreateDocx() {var rows = 3;var cols = 4; var doc = newGcWordDocument();var pars = doc.Body.Paragraphs; pars.Add("Demo of All Built-in Table Styles", doc.Styles[BuiltInStyleId.Title]); foreach (BuiltInStyleId id inEnum.GetValues(typeof(BuiltInStyleId))) {if (id == BuiltInStyleId.User)continue;var style = doc.Styles[id];if (style.Type != StyleType.Table)continue; pars.Add($"The following table is formatted using style '{style.Name}':");var table = doc.Body.Tables.Add(cols, rows, style);for (int row = 0; row < rows; ++row)for (int col = 0; col < cols; ++col) table.Rows[row].Cells[col].GetRange().Paragraphs.First.GetRange().Runs.Add($"Cell ({row},{col})"); } // Done:return doc; } }}