请教:ASP。NET 如何设置DATALIST控件相同的列完本来以为加个表格可以!但是还是不行datalist 总共有四列
第一列最宽,2,3,4依次变小,不知道为什么?

解决方案 »

  1.   

    列宽? width="100px" 属性不能用?
      

  2.   

    <asp:DataList ID="DataList1" runat="server"  RepeatDirection="Horizontal" 
            RepeatColumns="4" Width="100%" BackColor="White" BorderColor="#DEDFDE" 
            BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" 
            GridLines="Vertical" Height="185px">
                <AlternatingItemStyle BackColor="White" />
                <FooterStyle BackColor="#CCCC99" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <ItemStyle Width="50%" BackColor="#F7F7DE"/>
    <ItemTemplate>
            <table width="175%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="175">
                商品名称:<%#DataBinder.Eval(Container.DataItem,"orderid")%><br />订单日期:<font color="blue"><%#DataBinder.Eval(Container.DataItem,"orderdate","{0:d}")%><br /></font>公司名称:<%#DataBinder.Eval(Container.DataItem,"companyname")%><br />雇员姓名:<%#DataBinder.Eval(Container.DataItem,"employeename")%><br /></td>
              </tr>
            </table>
    </ItemTemplate>
                <SelectedItemStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            </asp:DataList>我的代码是这样的