gridview我自定了列宽 但是在IE上,却是 列宽是平分的

部分代码如下:
<asp:GridView ID="GridView1" runat="server" Width="5800px"  
  AutoGenerateColumns="False"  
  onselectedindexchanged="GridView1_SelectedIndexChanged">
  <Columns>
  <asp:CommandField ShowSelectButton="True">
  <ItemStyle Width="40px" />
  </asp:CommandField>
  <asp:BoundField DataField="no" HeaderText="工号">
  <ItemStyle Width="60px" />
  </asp:BoundField>
  <asp:BoundField DataField="ha01" HeaderText="姓名" >
  <ItemStyle Width="60px" />
  </asp:BoundField>
  <asp:BoundField DataField="ha02" HeaderText="姓别" >
  <ItemStyle Width="60px" />
  </asp:BoundField>
  <asp:BoundField DataField="ha03" HeaderText="部门" >
  <ItemStyle Width="60px" />
  </asp:BoundField>
  <asp:BoundField DataField="ha04" HeaderText="班组车间" >
  <ItemStyle Width="60px" />
  </asp:BoundField>   
  <asp:BoundField DataField="ha06" HeaderText="学历" >
  <ItemStyle Width="60px" />
  </asp:BoundField>
  <asp:BoundField DataField="ha07" HeaderText="民族" >
  <ItemStyle Width="60px" />
  </asp:BoundField>
 <asp:BoundField DataField="ha19" HeaderText="备注" >
  <ItemStyle Width="150px" />
  </asp:BoundField> -------
在VS2008 上显示,列宽分布是按照width属性的,但在IE上却不是这样子了,好奇怪,我已经设了AutoGeneratecolumns属性等于false,请高人的指点指点

 

我感觉源文件都是有宽度变化的,但是呈现出来的却没有宽度变化,是不是字段太多了
源文件如下:
style="width:60px;">初中</td><td style="width:60px;">&nbsp;</td><td style="width:60px;">&nbsp;</td><td style="width:70px;">&nbsp;</td><td style="width:60px;">&nbsp;</td><td style="width:60px;">&nbsp;</td><td style="width:60px;">&nbsp;</td><td style="width:60px;">&nbsp;</td><td style="width:60px;">13407048961</td><td style="width:70px;">&nbsp;</td><td style="width:60px;">362531197812273627</td><td style="width:70px;">1978-12-1 0:00:00</td><td style="width:250px;">江西省抚州市东乡县邓家乡松湖村下园组12号</td><td style="width:70px;">&nbsp;</td><td

哆啦的时光机
浏览 485回答 6
6回答

杨__羊羊

和table的布局方式也有关系,css: 自动布局,根据内容大小: {   table-layout:auto; } 固定布局,根据设置的宽高: {   table-layout:fixed; }

慕桂英3389331

可以试一下gridview中的column属性ItemStyle-Width和ItemStyle-Hight可以固定其宽度及高度

红颜莎娜

有没有列子呀

千万里不及你

<div >         <asp:Panel runat="server" ScrollBars="Both" BorderColor="Blue"             Border BorderWidth="1px" Width="51%" Height="72px">             <asp:GridView runat="server" AutoGenerateColumns="False"                 Height="62px" Width="499px">                 <Columns>                     <asp:BoundField HeaderText="工号" ItemStyle-Width="40px"   ItemStyle-Height="20px">                         <ItemStyle Width="40px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="姓名" ItemStyle-Width="60px" >                         <ItemStyle Width="60px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="姓别" ItemStyle-Width="60px" >                         <ItemStyle Width="60px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="部门" ItemStyle-Width="60px" >                         <ItemStyle Width="60px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="班组车间" ItemStyle-Width="110px" >                         <ItemStyle Width="60px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="学历" ItemStyle-Width="90px" >                         <ItemStyle Width="40px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="民族" ItemStyle-Width="110px" >                         <ItemStyle Width="60px" />                     </asp:BoundField>                     <asp:BoundField HeaderText="备注" ItemStyle-Width="200px" >                                           <ItemStyle Width="150px" />                     </asp:BoundField>                 </Columns>                           </asp:GridView>         </asp:Panel>     </div> 可根据情况调整。。。

MM们

你把标题也设置一下宽度。

桃花长相依

<asp:GridView runat="server" Width="5800px"  Width="5800px"  这么大?
打开App,查看更多内容
随时随地看视频慕课网APP