repeater 控件绑定数据列时怎么控制模板列显示的宽度
4个回答
展开全部
你在repeater 里绑定的是什么 比如在repeater 里嵌的是 table 的话 用table 的 宽度 长度 高度
去控制 repeater
去控制 repeater
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
数据是放在td中的吧,设置td的宽度不就可以了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你可以试着使用CSS控制每个模版列的宽度
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
给你一个示例代码
<asp:Repeater ID="Repeater1" runat="server" >
<HeaderTemplate><table > <tr>
<td width="4%"></td>
<td width="9%"></td>
<td width="87%" colspan ="4"></td>
</tr></HeaderTemplate>
<ItemTemplate>
<tr>
<td width="4%"> <asp:Image ID ="img" runat ="server" Height ="10" Width ="11" ImageUrl ="~/image/000000.gif"/></td>
<td width="9%"><asp:Label ID="Label1" Text ="项目名称:" runat ="server" ></asp:Label></td>
<td width="75%" colspan ="3"><asp:TextBox ID="tebname" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"项目名称")%> BorderWidth="0px" Width="100%" ></asp:TextBox></td>
<td width="12%"><asp:LinkButton ID="edit" runat ="server" CommandName="edit" Text ="更新" ></asp:LinkButton><asp:LinkButton ID="LinkButton1" runat ="server" CommandName="delect" Text ="删除" ></asp:LinkButton></td>
</tr>
<tr>
<td width="4%"></td>
<td width="9%"><asp:Label ID="Label2" Text ="招标人:" runat ="server" ></asp:Label></td>
<td width="32%"><asp:TextBox ID="TextBox1" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"招标人")%> BorderWidth="0px" Width="100%" ></asp:TextBox></td>
<td width="9%"><asp:Label ID="Label3" Text ="代理机构:" runat ="server" ></asp:Label></td>
<td width="34%"><asp:TextBox ID="TextBox2" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"代理机构")%> BorderWidth="0px" Width="100%" ></asp:TextBox></td>
<td width="12%"></td>
<td></td>
<tr>
<td width="4%"></td>
<td width="9%"><asp:Label ID="Label5" Text ="资审备案:" runat ="server" ></asp:Label></td>
<td width="87%" colspan ="4">
<table>
<tr>
<td><asp:Label ID="Label8" Text ="" runat ="server" ></asp:Label></td></td>
<td><asp:Label ID="Label4" Text ="审查时间:" runat ="server" ></asp:Label></td>
<td><asp:TextBox ID="TextBox3" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"审查时间")%> BorderWidth="0px" Width="80px" ></asp:TextBox></td>
<td><asp:Label ID="Label7" Text ="审查情况:" runat ="server" ></asp:Label></td>
<td><asp:TextBox ID="TextBox4" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"审查情况")%> BorderWidth="0px" Width="80px" ></asp:TextBox></td>
</tr></table>
</td>
</tr>
<tr>
<td width="4%"></td>
<td width="9%"><asp:Label ID="Label6" Text ="招标备案:" runat ="server" ></asp:Label></td>
<td width="87%" colspan ="4"></td>
</tr>
</ItemTemplate>
<SeparatorTemplate><tr><td bgcolor ="#CCCCFF" colspan ="6"><hr /></td></tr></SeparatorTemplate>
<FooterTemplate ></table></FooterTemplate>
</asp:Repeater>
<asp:Repeater ID="Repeater1" runat="server" >
<HeaderTemplate><table > <tr>
<td width="4%"></td>
<td width="9%"></td>
<td width="87%" colspan ="4"></td>
</tr></HeaderTemplate>
<ItemTemplate>
<tr>
<td width="4%"> <asp:Image ID ="img" runat ="server" Height ="10" Width ="11" ImageUrl ="~/image/000000.gif"/></td>
<td width="9%"><asp:Label ID="Label1" Text ="项目名称:" runat ="server" ></asp:Label></td>
<td width="75%" colspan ="3"><asp:TextBox ID="tebname" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"项目名称")%> BorderWidth="0px" Width="100%" ></asp:TextBox></td>
<td width="12%"><asp:LinkButton ID="edit" runat ="server" CommandName="edit" Text ="更新" ></asp:LinkButton><asp:LinkButton ID="LinkButton1" runat ="server" CommandName="delect" Text ="删除" ></asp:LinkButton></td>
</tr>
<tr>
<td width="4%"></td>
<td width="9%"><asp:Label ID="Label2" Text ="招标人:" runat ="server" ></asp:Label></td>
<td width="32%"><asp:TextBox ID="TextBox1" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"招标人")%> BorderWidth="0px" Width="100%" ></asp:TextBox></td>
<td width="9%"><asp:Label ID="Label3" Text ="代理机构:" runat ="server" ></asp:Label></td>
<td width="34%"><asp:TextBox ID="TextBox2" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"代理机构")%> BorderWidth="0px" Width="100%" ></asp:TextBox></td>
<td width="12%"></td>
<td></td>
<tr>
<td width="4%"></td>
<td width="9%"><asp:Label ID="Label5" Text ="资审备案:" runat ="server" ></asp:Label></td>
<td width="87%" colspan ="4">
<table>
<tr>
<td><asp:Label ID="Label8" Text ="" runat ="server" ></asp:Label></td></td>
<td><asp:Label ID="Label4" Text ="审查时间:" runat ="server" ></asp:Label></td>
<td><asp:TextBox ID="TextBox3" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"审查时间")%> BorderWidth="0px" Width="80px" ></asp:TextBox></td>
<td><asp:Label ID="Label7" Text ="审查情况:" runat ="server" ></asp:Label></td>
<td><asp:TextBox ID="TextBox4" runat ="server" ForeColor="#0000FF"
Text =<%#DataBinder.Eval(Container.DataItem ,"审查情况")%> BorderWidth="0px" Width="80px" ></asp:TextBox></td>
</tr></table>
</td>
</tr>
<tr>
<td width="4%"></td>
<td width="9%"><asp:Label ID="Label6" Text ="招标备案:" runat ="server" ></asp:Label></td>
<td width="87%" colspan ="4"></td>
</tr>
</ItemTemplate>
<SeparatorTemplate><tr><td bgcolor ="#CCCCFF" colspan ="6"><hr /></td></tr></SeparatorTemplate>
<FooterTemplate ></table></FooterTemplate>
</asp:Repeater>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |