# Tab Stops

Tab stops enable text alignment by pressing the Tab key from the keyboard in Word documents. Learn how to specify a tab stop using DsWord in your document.

## Content

Tab stops are used in Word documents to enable text alignment by pressing the Tab key from the keyboard. There are generally five types of tab stops, namely, left, right, center, decimal, and bar tab.
DsWord allows you to specify tab stop properties for a paragraph using the [TabStop](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.TabStop.html) class which can be accessed using [TabStops](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ParagraphFormat.TabStops.html) property of the [ParagraphFormat](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.ParagraphFormat.html) class. It supports all the five types of tab stops which can be set using [Alignment](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.TabStop.Alignment.html) property of the **TabStop** class. This property takes value from the [TabStopAlignment](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.TabStopAlignment.html) enumeration.

## Get Tab Stops

To get the tab stops:

1. Access a paragraph from the paragraph collection using [Paragraphs](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.RangeBase.Paragraphs.html) property of the **RangeBase** class.
2. Access the paragraph formatting properties using [Format](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.Paragraph.Format.html) property of the **Paragraph** class.
3. Get the tab stop properties applied to the paragraph using **TabStops** property of the **ParagraphFormat** class.
4. Get tab stop property. For example, get the position of the tab stop in points using [Position](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.TabStop.Position.html) property of the **TabStop** class.
5. Display the indent value on the console.

    ```csharp
    //Get tab stops
    Console.WriteLine("Tab Stop: "+ 
        doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.TabStops[0].Position);
    ```

## Set Tab Stops

To set the tab stops:

1. Access a paragraph from the paragraph collection using **Paragraphs** property of the RangeBase class.
2. Access the paragraph formatting properties using **Format** property of the Paragraph class.
3. Get the tab stop properties applied to the paragraph using **TabStops** property of the ParagraphFormat class.
4. Add or replace the tab stop in the collection using [Add](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.TabStopCollection.Add.html) method of the [TabStopCollection](/document-solutions/dot-net-word-api/api/online/DS.Documents.Word/GrapeCity.Documents.Word.TabStopCollection.html) class.

    ```csharp
    //Set tab stops
    doc.Body.Sections.First.GetRange().Paragraphs.Last.Format.TabStops.Add(20, TabStopAlignment.Bar);
    ```

For more information on how to implement tab stops using DsWord, see [DsWord sample browser](https://developer.mescius.com/documents-api-word/demos/).