Word copy table styles

I have a publisher’s sample Word document containing a table in a particular style. I have an existing table in my document that is in the standard plain Word format. I’m trying to apply the publisher’s table format, which is not a Word built-in style, to mine.

However, when I
1. click on the squared cross icon on the top left of the publisher’s table (to select the text of all the rows of the table — see below):
selecting a table
2. click on format painter
3. highlight all rows of my (target) table
it just adjusts the font of the cell entries of my table, not the style of the table itself.

How do you apply the table style of a table to another?

asked Jan 2, 2018 at 16:57

Wuschelbeutel Kartoffelhuhn's user avatar

If the original document did not use a custom style to create the table, it appears you will need to create one from scratch or modify an existing style to match. I have not been able to find a way to save an existing table as a new style. You can save a table style to be used on new tables by creating a Quick Table entry (for more info, see answer here: Word 2013 — How to create a new table style from an existing table style?). This however cannot be used on existing tables.

If the publisher’s original document had a custom table style created and you copy the table into your document, that style should now show up in the Table Tools > Design > Table Styles section of your new document (when the table is selected). For example:

I created a table with a custom style in document 1:

custom

When I create a new document 2, it has the default Word styles:

default

Now if I copy the table with that style from document 1 into document 2, the custom style from document 1 now appears in the Table Styles section of document 2 as well, allowing me to apply that style to all subsequent tables:

copied

answered Jan 3, 2018 at 21:15

Ray M's user avatar

Ray MRay M

9248 silver badges8 bronze badges

The easiest way is to:

  • Duplicate the whole original table (your publisher table).
  • Empty its cells.
  • Put as many rows as your new table requires (add one + several Ctrl+Y).
  • Copy/paste the cells from your existing table to the duplicated table (before pasting select all the cells of the duplicated table).

karel's user avatar

karel

13.3k26 gold badges44 silver badges52 bronze badges

answered Mar 20, 2019 at 15:28

Manuel Rozier's user avatar

1

Should try left top corner and tick mark on Header row and Banded Rows. Then would be appear options like below:

enter image description here

enter image description here

Albin's user avatar

Albin

8,8296 gold badges46 silver badges83 bronze badges

answered Nov 29, 2018 at 10:26

Sanjay Kumar's user avatar

i’m trying to change width of columns in several identical tables. one way is Table Layout — Table to Text command or just copy as plain text into a new document. make it all one text section.
then convert text to table (insert table, convert text to table, select at tabs)
of course you’ll lose any text formatting

answered Oct 16, 2019 at 20:28

Leonard John-Paul's user avatar

0

На чтение 3 мин. Просмотров 47 Опубликовано 27.05.2021

Например, вы украсили таблицу в документе Word и хотите сохранить ее как новый стиль таблицы. Однако Microsoft Word не поддерживает создание нового стиля таблицы на основе выбора. Не волнуйся! В этой статье будет представлен обходной путь для быстрого сохранения стиля таблицы из существующей таблицы в Word.

Сохранение/создание стиля таблицы из существующей таблицы в Word

Содержание

  1. Просмотр и редактирование нескольких документов Word с вкладками в Firefox, Chrome, Internet Explore 10!
  2. Рекомендуемые инструменты повышения производительности для Word
  3. Сохранить/создать таблицу стиль из существующей таблицы в Word
  4. Похожие статьи
  5. Рекомендуемые инструменты для повышения производительности Word
  6. Kutools for Word – Больше чем 100 расширенных функций для Word, сэкономьте 50% времени

Просмотр и редактирование нескольких документов Word с вкладками в Firefox, Chrome, Internet Explore 10!

Возможно, вы знакомы с просмотром нескольких веб-страниц в Firefox/Chrome/IE , и легко переключаться между ними, щелкая соответствующие вкладки. Здесь вкладка Office поддерживает аналогичную обработку, которая позволяет просматривать несколько документов Word в одном окне Word и легко переключаться между ними, щелкая их вкладки. Нажмите, чтобы получить бесплатную пробную версию с полным набором функций!

Рекомендуемые инструменты повышения производительности для Word

Более 100 мощных расширенных функций для Word, сэкономьте 50% вашего времени. Бесплатная загрузка

Редактирование и просмотр с вкладками в Office (включая Word), гораздо более мощный, чем вкладки браузера. Бесплатная загрузка


Сохранить/создать таблицу стиль из существующей таблицы в Word

Хотя невозможно создать новый стиль таблицы из выбранной таблицы в Word, вы можете легко сохранить выбранную таблицу как быструю таблицу для повторного использования кликами. Пожалуйста, сделайте следующее:

1. Откройте исходный документ, таблицу которого вы сохраните как стиль таблицы, выберите всю таблицу и нажмите клавиши Ctrl + C вместе, чтобы скопировать ее.

2. Поместите курсор в пустой абзац, нажмите клавиши Ctrl + V , чтобы вставить его, а затем нажмите клавишу Delete , чтобы удалить все содержимое таблицы.

3. Выберите новую пустую таблицу и нажмите Вставить > Таблица > Быстрые таблицы > Сохранить выделение в Галерея быстрых таблиц . См. Снимок экрана:

4. В появившемся диалоговом окне «Создать новый стандартный блок» введите имя в поле Имя и нажмите кнопку ОК . См. Снимок экрана:

Теперь новая пустая таблица сохраняется как быстрая таблица.

Примечания:
(1) Чтобы повторно использовать эту быструю таблицу, нажмите Вставить > Таблица > Быстрые таблицы и щелкните указанную быструю таблицу в подменю. См. Снимок экрана:

(2) Вы не можете применить этот стиль быстрой таблицы к существующей таблице.

(3) Чтобы удалить быструю таблицу из галереи быстрых таблиц, (1) нажмите Insert > Таблица > Быстрые таблицы , (2) щелкните правой кнопкой мыши указанную быструю таблицу в подменю и выберите Организовать и Удалите , как показано на скриншоте ниже, и, наконец, (3) удалите его из всплывающего диалогового окна.


Похожие статьи

Как сохранить документ Word как изображение (png, jpeg и т. д.)?

Как экспортировать/сохранить/преобразовать таблицы как изображения в Word



Рекомендуемые инструменты для повышения производительности Word

Kutools for Word – Больше чем 100 расширенных функций для Word, сэкономьте 50% времени

  • Сложные и повторяющиеся операции могут быть выполнены единовременно за секунды.
  • Вставить несколько изображения из папок в документ Word сразу.
  • Объедините и объедините несколько файлов Word в папках в один в желаемом порядке.
  • Разделите текущий документ на отдельные документы в соответствии с в заголовок, разрыв раздела или другие критерии.
  • Преобразование файлов между Doc и Docx, Docx и PDF, набор инструментов для общих преобразований и выбора и так далее …

Подробнее Загрузить сейчас Купить


  • Remove From My Forums
  • Question

  • Hi

    This should be easy but I can not see any options to do this in Word 2007.

    I have a table that is used in a customers document format with various colour options etc that is not based on any standard style or font. I want to create a table style from it so I can then quickly apply the style to tables in my document in order
    to easily convert our standard format docs to look like theirs. They have not created any syles in their document unfortunately.

    I just want to select the table and then create new style based on it. I can click the Table Tools design new Style but I want it to say «based on selected» but there is nothing like that, I have to use a standard style.

    Any help would be appreciated

    Thanks in advance

    J

Answers

  • Hi J,

    How to apply a table style to an existing table in Word 2007, you can do following steps:

    1. Select the table. The Design and Layout tabs for
      Table Tools are added to the ribbon (A).
    2. Select the Design tab.
    3. In the Table Style group (on the left [B]), select the check boxes for the effects you want. For example, if this table has a header row, select that check box; if you want banded rows, select that check box; if you have a Totals row, select
      that one, etc. (See also:
      Tips for using built-in table styles.)
    4. In the Table Styles group (C), click the drop-down arrow to the right of the example styles to see ‘thumbnail’ views of various table styles; scroll down to see all the variations.
    5. Hover over various thumbnails (D) to see how each one looks when applied to your table.
    6. Click on the thumbnail for the style you want to apply.

    word2007_tables_toolbar

    Hope that helps.

    • Marked as answer by

      Thursday, October 21, 2010 5:20 AM

In this post, we will look at 2 useful ways to apply the same style to all tables in your Word document.

Every so often, we need to create tables in our Word document to place and arrange various data. And if there are a number of tables, it would be better to apply the same style to them so as to make the file appear more professional. For this reason, we’d like to exhibit you 2 methods in the coming texts.

Method 1: Apply the Same Style to a Table Individually

Once you insert a table in document, put cursor inside the table to trigger the “Table Tools” tab. Then click “Design” and choose a table style in the “Table Styles” library.Click "Design"->Choose a Table Style

However, in case you may want a novel style for your tables, you are fine to customize a new one by following the succeeding steps.

  1. Firstly, click the “More” button in “Table Styles” group.
  2. Then choose “New Table Style”.Choose "New Table Style"
  3. Now in the “Create New Style from Formatting” dialog box, name the new style first.
  4. Next set such formatting as font, font size, borders, Fill Color, etc.
  5. And select the “New documents based on this template” option.
  6. Lastly, click “OK”.Name the Style->Set Formatting->Click "OK"

If you want to format the table template in a more unique way, take a glance at this article: 2 Methods to Alternate Row or Column Colors in Your Word Table

Method 2: Manipulate Tables in Batches

In method 2, we have a macro for you to select all existing tables in an active document. Once tables are selected, you can apply whatever style for them in batches.

  1. First off, click “Developer” tab in the Ribbon.
  2. Then click “Visual Basic” to trigger the VBA editor.Click "Developer"->Click "Visual Basic"
  3. Next insert a new module by click “Normal” and then “Insert”.
  4. On the drop-down menu, choose “Module”.Click "Normal"->Click "Insert"->Click "Module"
  5. Double click new module to open coding area and paste the codes:
'Select all tables in a Word document.
Sub SelectAllTables()
  Dim objDoc As Document
  Dim objTable As Table
 
  Application.ScreenUpdating = False
 
  'Initialization
  Set objDoc = ActiveDocument
 
  'Set each table in document as a range editable to everyone.
  With objDoc
  For Each objTable In .Tables
    objTable.Range.Editors.Add wdEditorEveryone
  Next
  objDoc.SelectAllEditableRanges wdEditorEveryone
  objDoc.DeleteAllEditableRanges wdEditorEveryone
  Application.ScreenUpdating = True
  End With
End Sub
  1. Finally, hit “Run” button.Click "Run" to Run the Macro

Now all tables shall be selected already. You can apply a built-in or newly created style to all tables in the current document.All Tables being Selected

Cope with Word Data Loss

Loss of critical data can be a bane of people’s digital life. What’s sarcastic is we feel regret only after what’s done has been done. Since there is no use of mourning for the loss, we suggest you to get a tool to recover Word docx document error as soon as possible.

Author Introduction:

Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including Excel xls recovery product and pdf repair software products. For more information visit www.datanumen.com

A table style holds a set of table, row, cell, paragraph, and text formatting that can be applied to tables. Using table styles instead of directly formatting a table saves time in modifying the look of a table and switching to a different table style. It also allows you to reuse a style for several tables to format all your documents consistently.

In this article, we are going to learn how to create, apply, and modify table styles in Word documents programmatically in C# and VB.NET using the Syncfusion .NET Word Library (Essential DocIO) without Microsoft Word or Office interop dependencies.

The Syncfusion Word Library provides comprehensive APIs to apply built-in table styles, modify an existing table style, create new custom table styles, and copy table styles from one Word document to another. It saves you effort and time by helping you automate the formatting of the tables in your Word documents, using table styles programmatically in C# and VB.NET. The resultant documents can be saved as Word documents (DOCX, WordML), PDFs, images, HTML, and more.

Different formatting in Word table styles

After creating a table in a Word document, you can easily format that table by applying a table style. The table styles allow you to define unique formatting for each row and cell of a table through conditional formats. A table style can have 13 types of conditional formats:

  • Whole table—Holds common formatting that can be applied to an entire table.
  • Odd-banded columns—Holds special formatting that can be applied to the odd-banded columns.
  • Even-banded columns—Holds special formatting that can be applied to even-banded columns.
  • Odd-banded rows—Holds special formatting that can be applied to odd-banded rows.
  • Even-banded rows—Holds special formatting that can be applied to even-banded rows.
  • First row—Holds special formatting that can be applied to the first row.
  • Last row—Holds special formatting that can be applied to the last row.
  • First column—Holds special formatting that can be applied to the first column.
  • Last column—Holds special formatting that can be applied to the last column.
  • First row first cell—Holds special formatting that can be applied to the first row’s first cell (top-left corner cell).
  • First row last cell—Holds special formatting that can be applied to the first row’s last cell (top-right corner cell).
  • Last row first cell—Holds special formatting that can be applied to the last row’s first cell (bottom-left corner cell).
  • Last row last cell—Holds special formatting that can be applied to the last row’s last cell (bottom-right corner cell).

Even if a table style has definitions for all of these types of conditional formats, you can enable or disable the special formatting for a table through its table style options. There are six table-style options:

  • Header row
  • First column
  • Last row
  • Last column
  • Banded rows
  • Banded columns

Refer to our documentation for more information about enabling and disabling the style options of a table programmatically.

Apply built-in table styles to a Word table created from scratch in C#

Microsoft Word provides various built-in table styles to customize the look and feel of tables in Word documents. Using Syncfusion Word Library, you can apply any of these built-in table styles to a table programmatically with just a single line of code.

The following code example illustrates how to apply the built-in table style “Medium Shading 1 Accent 1” to a table created from scratch in a Word document (DOCX).

//Creates new Word document instance for Word processing.
using (WordDocument document = new WordDocument())
{
    //Adds a section to the Word document.
    IWSection section = document.AddSection();
    //Sets the page margin
    section.PageSetup.Margins.All = 72;
    //Adds a paragraph to the section.
    IWParagraph paragraph = section.AddParagraph();
    paragraph.ParagraphFormat.HorizontalAlignment = HorizontalAlignment.Center; 
    paragraph.ParagraphFormat.AfterSpacing = 20;
    IWTextRange textRange = paragraph.AppendText("Suppliers");
    textRange.CharacterFormat.FontSize = 14;
    textRange.CharacterFormat.Bold = true;
    textRange.CharacterFormat.TextColor = Syncfusion.Drawing.Color.FromArgb(255, 50, 62, 79);
    //Modifies the font size to 10 for default paragraph style.
    WParagraphStyle style = document.Styles.FindByName("Normal") as WParagraphStyle;
    style.CharacterFormat.FontSize = 10;
    //Adds a table to the section.
    WTable table = section.AddTable() as WTable;
    table.ResetCells(1, 6);
    table[0, 0].Width = 52f;
    table[0, 0].AddParagraph().AppendText("Supplier ID");
    table[0, 1].Width = 128f;
    table[0, 1].AddParagraph().AppendText("Company Name");
    table[0, 2].Width = 70f;
    table[0, 2].AddParagraph().AppendText("Contact Name");
    table[0, 3].Width = 92f;
    table[0, 3].AddParagraph().AppendText("Address");
    table[0, 4].Width = 66.5f;
    table[0, 4].AddParagraph().AppendText("City");
    table[0, 5].Width = 56f;
    table[0, 5].AddParagraph().AppendText("Country");
    //Imports data to the table.
    ImportDataToTable(table);
    //Applies the built-in table style (Medium Shading 1 Accent 1) to the table.
    table.ApplyStyle(BuiltinTableStyle.MediumShading1Accent1);
    //Saves the file in the given path.
    docStream = File.Create(Path.GetFullPath(@"Result.docx"));
    document.Save(docStream, FormatType.Docx);
    docStream.Dispose();
}

Generated Word document with built-in table style Medium Shading 1 Accent 1

Generated Word document with built-in table style Medium Shading 1 Accent 1

The complete working example can be downloaded from this GitHub location.

Modify an existing Word table style

Using Syncfusion Word Library, you can access a table style from a Word document using its style name and modify the properties of the table style programmatically in a few lines of code.

The following code example illustrates how to access and modify an existing table style from a Word document (DOCX).

//Creates new Word document instance for Word processing.
using (WordDocument document = new WordDocument())
{
    //Opens the input Word document.
    Stream docStream = File.OpenRead(Path.GetFullPath(@"../../../Table.docx"));
    document.Open(docStream, FormatType.Docx);
    docStream.Dispose();
    //Gets the table style (Medium Shading 1 Accent 1) from the styles collection.
    WTableStyle tableStyle = document.Styles.FindByName("Medium Shading 1 Accent 1", StyleType.TableStyle) as WTableStyle;
    //Gets the conditional formatting style of the first row (table headers) from the table style.
    ConditionalFormattingStyle firstRowStyle = tableStyle.ConditionalFormattingStyles[ConditionalFormattingType.FirstRow];
    if (firstRowStyle != null)
    {
        //Modifies the background color for first row (table headers).
        firstRowStyle.CellProperties.BackColor = Syncfusion.Drawing.Color.FromArgb(255, 31, 56, 100);
    }
    //Saves the file in the given path.
    docStream = File.Create(Path.GetFullPath(@"Result.docx"));
    document.Save(docStream, FormatType.Docx);
    docStream.Dispose();
}

Table style with first row background color modified

Table style with first-row background color modified

The complete working example can be downloaded from this GitHub location.

Create and apply custom table styles to an existing table

Syncfusion Word Library allows you to create a new custom table style and apply it to a table in a Word document. For more details, refer to the documentation.

The following code example illustrates how to create a new custom table style and apply the new custom table style to an existing table in a Word document (DOCX).

//Creates new Word document instance for Word processing.
//Creates new Word document instance for Word processing.
WordDocument document = new WordDocument();
//Opens the input Word document.
Stream docStream = File.OpenRead(Path.GetFullPath(@"../../../Table.docx"));
document.Open(docStream, FormatType.Docx);
docStream.Dispose();
//Adds a new custom table style.
WTableStyle tableStyle = document.AddTableStyle("CustomStyle") as WTableStyle;
//Applies formatting for whole table.
tableStyle.TableProperties.RowStripe = 1;
tableStyle.TableProperties.ColumnStripe = 1;
tableStyle.TableProperties.Paddings.Top = 0;
tableStyle.TableProperties.Paddings.Bottom = 0;
tableStyle.TableProperties.Paddings.Left = 5.4f;
tableStyle.TableProperties.Paddings.Right = 5.4f;
//Applies conditional formatting for first row.
ConditionalFormattingStyle firstRowStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.FirstRow);
firstRowStyle.CharacterFormat.Bold = true;
firstRowStyle.CharacterFormat.TextColor = Syncfusion.Drawing.Color.FromArgb(255, 255, 255, 255);
firstRowStyle.CellProperties.BackColor = Syncfusion.Drawing.Color.Blue;
//Applies conditional formatting for first column.
ConditionalFormattingStyle firstColumnStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.FirstColumn);
firstColumnStyle.CharacterFormat.Bold = true;
//Applies conditional formatting for odd row.
ConditionalFormattingStyle oddRowBandingStyle = tableStyle.ConditionalFormattingStyles.Add(ConditionalFormattingType.OddRowBanding);
oddRowBandingStyle.CellProperties.BackColor = Syncfusion.Drawing.Color.WhiteSmoke;
//Gets table to apply style.
WTable table = (WTable)document.LastSection.Tables[0];
//Applies the custom table style to the table.
table.ApplyStyle("CustomStyle");
//Saves the file in the given path.
docStream = File.Create(Path.GetFullPath(@"Result.docx"));
document.Save(docStream, FormatType.Docx);
docStream.Dispose();
//Releases the resources of Word document instance.
document.Dispose();

Word document with custom table style

Word document with custom table style

The complete working example can be downloaded from this GitHub location.

Copy table styles from one Word document to another

Syncfusion Word library allows you to access an existing table style from one Word document through its style name and copy the table style to another Word document programmatically in just a few lines of code.

The following code example illustrates how to copy an existing table style – “CustomStyle” from a Word document (DOCX) to another.

//Creates new Word document instance for Word processing.
using (WordDocument document = new WordDocument())
{
    //Opens the input Word document.
    Stream docStream = File.OpenRead(Path.GetFullPath(@"../../../Table.docx"));
    document.Open(docStream, FormatType.Docx);
    docStream.Dispose();
    //Opens the source Word document containing table style definition.
    WordDocument srcDocument = new WordDocument();
    docStream = File.OpenRead(Path.GetFullPath(@"../../../TableStyles.docx"));
    srcDocument.Open(docStream, FormatType.Docx);
    docStream.Dispose();
    //Gets the table style (CustomStyle) from the styles collection.
    WTableStyle srcTableStyle = srcDocument.Styles.FindByName("CustomStyle", StyleType.TableStyle) as WTableStyle;
    //Creates a cloned copy of table style.
    WTableStyle clonedTableStyle = srcTableStyle.Clone() as WTableStyle;
    //Adds the cloned copy of source table style to the destination document. 
    document.Styles.Add(clonedTableStyle);
    //Releases the resources of source Word document instance.
    srcDocument.Dispose();
    //Gets table to apply style.
    WTable table = (WTable)document.LastSection.Tables[0];
    //Applies the custom table style to the table.
    table.ApplyStyle("CustomStyle");
    //Saves the file in the given path.
    docStream = File.Create(Path.GetFullPath(@"Result.docx"));
    document.Save(docStream, FormatType.Docx);
    docStream.Dispose();
}

The complete working example can be downloaded from this GitHub location.

Summary

Thank you for taking the time to read this article. I hope that it is useful for you and that it has answered your questions on using table styles in a Word document using Syncfusion Word Library.

Take a moment to peruse our documentation, where you’ll find other options and features, all with accompanying code examples. Using the library, you can create, edit, merge Word documents and also convert a Word document to a PDF, image, HTML, RTF, and more.

If you are new to our Word Library (Essential DocIO), we highly recommend that you follow our Getting Started guide.

Are you already a Syncfusion user? You can download the product setup here. If you’re not yet a Syncfusion user, you can download a free, 30-day trial here.

If you have any questions about these features, please let us know in the comments below. You can also contact us through our support forum, Direct-Trac, or feedback portal. We are happy to assist you!

Like this post? Please share to your friends:
  • Word cooking in japanese
  • Word combination с переводом
  • Word combination в английском языке
  • Word combination with work
  • Word combination with money