Reduce the gap between the rows and gap should be equal for all the rows in the form by using css in asp.net
Loading
Reduce the gap between the rows and gap should be equal for all the rows in the form by using css in asp.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sandhiya PriyaPosted Jan 2, 2026, 11:46 AM
To reduce and equalize the gap between rows in an ASP.NET form, you should control spacing using CSS, not HTML tables or
tags.Recommended approach (CSS class for rows)
1. Wrap each row in a common CSS class
2. Define spacing in CSS
Change
8pxto any value you want.If you are using

VP 
VP 
or
If you are using Bootstrap
or
What NOT to do
Don’t use multiple
tagsDon’t use inline styles repeatedly
Don’t set different margins per control
Summary
Use one CSS class for all rows
Control spacing with
margin-bottomorpaddingEnsures equal gap everywhere
Works in all ASP.NET forms
This is the cleanest and correct CSS-based solution.
Satya KarkiPosted May 3, 2023, 10:10 AM
Hi, you can use Bootstrap Grid. If you are new you can get an understanding in detail from the below links
https://www.w3schools.com/bootstrap/bootstrap_grid_system.asp
https://www.w3schools.com/bootstrap/bootstrap_grid_small.asp
Better share your code.
vidhyadar PPosted May 3, 2023, 9:16 AM
Noo,I am not using table
Jignesh KumarPosted May 3, 2023, 8:26 AM
Are you using table ?
vidhyadar PPosted May 3, 2023, 8:11 AM
No, I am not using the Gridview ,I am using the Css for the design of the page.
Jignesh KumarPosted May 3, 2023, 8:07 AM
Hello,
Are you using Grdview then you can use,