6
                  Container(
                        height: 100,
                        width: 350,
                        decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.all(
                            Radius.circular(15),
                          ),
                        ),
                        child: Table(
                          defaultColumnWidth: FixedColumnWidth(120.0),
                          border: TableBorder.all(
                            color: Colors.grey[600],
                            //style: BorderStyle.solid,
                            width: 0.5,
                          ),
                          children: [
                            TableRow(),
                            TableRow(),
                            TableRow(),
                              ],
                              
                               ),
                          
                              ],
                            ),
                          ],
                        ),
                      ),

I need to remove the outermost border line of this table. I here use Table widget to show the table. The image with this is the output i want. Is there any method to remove the outermost lines or any other ideas to make like this. https://drive.google.com/file/d/1v1BWmO56m6Zq4kPgiyOoCzv8K2XvrFU7/view?usp=sharing is the link of the widget i want to build.

1

2 Answers 2

10
child: Table(
    border: TableBorder(horizontalInside: BorderSide(width: 1, color: Colors.blue, style: BorderStyle.solid)),

This is how you can remove the border of the table in flutter.

Sample of the dart pad is attached below👇
https://dartpad.dev/0bc0f378c2722dc94e7a8c583180705e

For reading more about the article you can look ahead at https://medium.com/flutter-community/table-in-flutter-beyond-the-basics-8d31b022b451

Sign up to request clarification or add additional context in comments.

Comments

3

In the TableBorder class there's a property TableBorder.symmetric which specifies the outer and inner border separately.

The optimized code would look like:

Table(
   border: TableBorder.symmetric(
       outside: BorderSide.none, 
       inside: const BorderSide(width: 1, color: Colors.grey, style: BorderStyle.solid),
   ),
   children: [
       TableRow(),
       TableRow(),
       TableRow(),
   ],
)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.