Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files from any .NET platform (C#, VB.NET, ASP.NET, .NET Core) and Java applications (J2SE and J2EE) with fast and high quality performance.

Wed Mar 10, 2021 7:32 pm

Hi i have this problem when i fill data.
The words are not aligned

1.png


I want this

2.png
You do not have the required permissions to view the files attached to this post.

josefreyle
 
Posts: 5
Joined: Tue Sep 01, 2020 3:11 pm

Thu Mar 11, 2021 6:18 am

Hello,

Thanks for your inquiry.
Please set the first line indent and left indent of the paragraph to 0 to achieve your requirements, as shown below.
Code: Select all
            Document document = new Document();
            Section section = document.AddSection();
            Table table = section.AddTable();
            table.TableFormat.Borders.BorderType = BorderStyle.Hairline;
            TableRow tableRow = table.AddRow();
            TableCell tableCell = tableRow.AddCell();           
            Paragraph paragraph = tableCell.AddParagraph();
            TextRange textRange1 = paragraph.AppendText("This is a paragraph.");
            paragraph.Format.FirstLineIndent = 0;
            paragraph.Format.LeftIndent = 0;

If there are any other questions related to our products, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 780
Joined: Mon Oct 19, 2020 3:04 am

Fri Mar 19, 2021 7:41 am

Hello,

Greetings from E-iceblue!
Did the code we provided work for you? Any feedback will be greatly appreciated.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 780
Joined: Mon Oct 19, 2020 3:04 am

Sat Apr 10, 2021 2:51 am

Thanks now is ok

josefreyle
 
Posts: 5
Joined: Tue Sep 01, 2020 3:11 pm

Mon Apr 12, 2021 1:29 am

You are welcome.
If you encounter any issues related to our products in the future, please feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 780
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc