How to rid of empty div that contains a GridView

前端 未结 8 837
时光说笑
时光说笑 2021-01-11 18:21

In ASP.NET Gridviews generate a table which generates a parent div container. This can break CSS layouts since there is no way to attach styles to the generated div. Is ther

8条回答
  •  我在风中等你
    2021-01-11 18:47

    Simplest and best solution using CSS class "gridViewWrapperFix".

    ASPX:

    <%--the full gridview would go here--%>

    CSS:

    /* styles the div that gets auto generated around and asp.net gridview */
    
    .gridViewWrapperFix > div { 
        padding: 0; 
        margin: 0; 
        border: 3px solid red;
    }
    

提交回复
热议问题