Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html Gridview 100%位于分区内_Html_Css_Asp.net_Gridview - Fatal编程技术网

Html Gridview 100%位于分区内

Html Gridview 100%位于分区内,html,css,asp.net,gridview,Html,Css,Asp.net,Gridview,所以在我的网页上,我有3个div是浮动的和flex的(在另一个div中),中间的div目前有一个gridview,这里是代码的简化版本 <div style=" width:100%; display:flex; height:inherit" > <div style=" flex: 1; float:left; padding: 1em; padding-bottom: 15em; margin-bottom: -15em; ">

所以在我的网页上,我有3个div是浮动的和flex的(在另一个div中),中间的div目前有一个gridview,这里是代码的简化版本

<div style=" width:100%; display:flex; height:inherit" >
            <div style=" flex: 1; float:left; padding: 1em; padding-bottom: 15em; margin-bottom: -15em; ">
            (code...)
            </div>
            <div style="flex: 1; float:left; padding: 1em; border-right:1px solid gray; border-left:1px solid gray; ">    
            <asp:GridView ID="dgvMarcacoes" runat="server" OnRowDataBound = "OnRowDataBound" AutoGenerateSelectButton="True" >
                    <Columns>

                        <asp:BoundField HeaderText="Data" />
                        <asp:BoundField HeaderText="Utente" />
                        <asp:BoundField HeaderText="Nome" />
                        <asp:BoundField HeaderText="Série" />
                        <asp:BoundField HeaderText="Tipo" />
                        <asp:BoundField HeaderText="Estado" />

                    </Columns>    
                    <SelectedRowStyle BorderColor="Black" BorderStyle="Solid" />
            </asp:GridView>    
            </div> 

            <div style=" flex: 1; float:left; padding: 1em; padding-bottom: 15em; margin-bottom: -15em;">
            (code...)
            </div> 
    </div>
还添加了这样的样式

<asp:GridView ID="dgvMarcacoes" runat="server" OnRowDataBound = "OnRowDataBound" AutoGenerateSelectButton="True" style="width:100%" >
这里有什么帮助吗?(顺便说一句,我想拉伸的网格是中间部分(第二部分))谢谢


编辑:所以我试着删除其中一列,看看问题是否是网格太大,但这是一个相同的图片,我通过删除
padding:1em解决了这个问题从中间的div

您的GridView太宽了,它不适合。删除一列或使用CSS
word break:break all
我删除了一列以查看是否是问题,但没有,它保持不变,我会编辑我的问题,并打印它如何保持不变
<asp:GridView ID="dgvMarcacoes" runat="server" OnRowDataBound = "OnRowDataBound" AutoGenerateSelectButton="True" style="width:100%" >