不能`不能`怎么就横不过来呢...Why!Why!Why!
我在弄搜索`结果怎么也不能一行显示`
代码这样:
<div>
<asp:TextBox ID= "txtsearch " runat= "server "/>
<asp:Button ID= "btnsearch " runat= "server " Text= "搜索 "/>
热门搜索: <asp:DataList ID= "DataList5 " runat= "server " RepeatColumns= "4 " RepeatDirection= "Vertical " DataSourceID= "SqlDataSource5 ">
<ItemTemplate> <asp:Label ID= "KeyWordLabel " runat= "server " Text= ' <%# Eval( "KeyWord ") %> ' /> </ItemTemplate>
</asp:DataList>
</div>
我的错误效果是:
---------------------------------
-----------------
| TextBox | 搜索 热门搜索:
-----------------
-----------------------------
| 热门搜索关键字 |
-----------------------------
----------------------------------
我也用CSS写了`可 他..他他...就是不能一行`不知道是不是方法错`
帮帮啊`
------解决方案--------------------楼上说的对,也可以用 <table> <tr> <td> 1 </td> <td> 2 </td> <td> 3 </td> </tr> </table> 进行排列
------解决方案--------------------datalist 没有style属性
==========
不用管它,写上再说。
------解决方案--------------------你要的效果不就是这样的嘛
<style>
.c1{
}
.c1 ul{
float:right;
list-style-type:none;
padding:0px;
margin:0px;
width:50%;
}
.c1 li{
float:left;
width:25%;
}
</style>
<div class= "c1 ">
<ul>
<li> 关键字1 </li>
<li> 关键字2 </li>
<li> 关键字3 </li>
<li> 关键字4 </li>
<li> 关键字5 </li>
</ul>
<input type= "text "> <button> 搜索 </button> 热门搜索:
</div>
------解决方案-------------------- <div>
<table border=0 cellpadding=0 cellspacing=0> <tr>
<td> <asp:TextBox ID= "txtsearch " runat= "server "/> </td>
<td> <asp:Button ID= "btnsearch " runat= "server " Text= "搜索 "/> </td>
<td nowrap>
热门搜索:
<asp:DataList ID= "DataList5 " runat= "server " RepeatColumns= "4 "
RepeatDirection= "Vertical " DataSourceID= "SqlDataSource5 ">
<ItemTemplate> <asp:Label ID= "KeyWordLabel " runat= "server "
Text= ' <%# Eval( "KeyWord ") %> ' /> </ItemTemplate>
</asp:DataList>
</td>
</tr> </table>
</div>