Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Mon Oct 16, 2023 7:30 am

Hi Team ,

Please let us know that how to change the row's and column's line color(in blue color) .

Thanks in advance

pr20080798
 
Posts: 159
Joined: Wed Jan 20, 2021 1:15 pm

Mon Oct 16, 2023 8:16 am

Hi,

Thank you for your inquiry.
I put the complete code below for your referenece:
Code: Select all
 //Create Document
        Document document = new Document();
        //Load Word Document
        document.loadFromFile("data/test.docx");

        //Get the first section
        Section section = document.getSections().get(0);

        //Get the first table in the section
        Table table = section.getTables().get(0);

        //Set the horizontal and vertical borders of the table
        table.getTableFormat().getBorders().getVertical().setBorderType(BorderStyle.Hairline);
        table.getTableFormat().getBorders().getHorizontal().setBorderType(BorderStyle.Hairline);
        table.getTableFormat().getBorders().getVertical().setColor(Color.BLUE);
        table.getTableFormat().getBorders().getHorizontal().setColor(Color.BLUE);

        //Save
        document.saveToFile("output/setTableStyleAndBorder.docx", FileFormat.Docx_2013);

If you have any issue just feel free to contact us.

Sincerely,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Mon Nov 13, 2023 6:02 am

Hello,

Did you test the code on your side? Did it solve your problem?
Please feel free to us if you have any problem.

Best Regards,
Ula
E-iceblue support team
User avatar

Ula.wang
 
Posts: 282
Joined: Mon Aug 07, 2023 1:38 am

Return to Spire.Doc