2017-03-16 73 views
0

所以在我的网页里面%我有3个div的是漂浮和Flex(和其他DIV中)和中间的div目前已经在这里一个gridview是代码GridView的100一个div

<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> 
的简化版本

和我尝试做使电网100%的宽度,但没有成功,我已经尝试在电网代码添加width=100%这样

<asp:GridView ID="dgvMarcacoes" runat="server" OnRowDataBound = "OnRowDataBound" AutoGenerateSelectButton="True" width=100%> 

并且还加入了风格类似这样的

<asp:GridView ID="dgvMarcacoes" runat="server" OnRowDataBound = "OnRowDataBound" AutoGenerateSelectButton="True" style="width:100%" > 

但它保持不变...这里是它是如何atm的图片:pic在这里的任何帮助? (顺便说一句,我试图拉伸的网格是在中间div(div2))谢谢,

编辑:所以我试图删除其中一列,看看问题是网格太大,但其相同这里是一个事先知情同意pic

+0

你的GridView是太宽去除padding: 1em;解决了这个问题,它只是不适合。删除一列或使用CSS'word-break:break-all' – VDWWD

+0

我删除了一列以查看它是否是问题,但不是,它保持不变il编辑我的问题并打印它如何保留 –

回答

0

嗯,我从中间DIV