移动table的td问题
<table style= "width: 100% " background= "images/head_left.gif ">
<tr>
<td align= "left " style= "width:15px; height:15px " valign= "middle "> <img src= " " style= "background-image: url(images/ico/jtzuo.jpg); width: 15px; height: 15px " alt= " " /> </td>
<td style= "width:55px; height:15px; background-image: url(images/Button3.gif); " align= 'center ' valign= "middle " > <a href= 'Default.aspx ' target= 'mainFrame ' > 首 页 </a> </td>
<% Response.Write(GetHead());%>
<td align= "left " style= "width:15px; height:15px " valign= "middle "> <img src= " " style= "width: 15px; height: 15px; background-image: url(images/ico/jtyou.jpg); " alt= " " /> </td>
</tr>
</table>
以上是HTML代码。
以下是cs代码
protected string GetHead()
{
DataSet ds = new DataSet();
string TableBody = " ";
ds = Purview.GetOperation( " ");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
if (ds.Tables[0].Rows[i][1].ToString() == "客户 ")
{ //style= 'background-image: url(images/Button2.gif) 'style= "width:69px; height:15px; color: white; "
TableBody = TableBody + " <td width= '55 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= 'Client/Client.aspx ' target= 'mainFrame '> 客 户 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "客户基本资料 ")
{
TableBody = TableBody + " <td width= '79 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= 'Client/ClientData.aspx ' target= 'mainFrame '> 客户基本资料 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "潜在客户 ")
{
TableBody = TableBody + " <td width= '69 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= '../EvectionReportData/EvectionReport.aspx ' target= 'mainFrame ' onmousedown= 'window.alert(obj.parentElement.id) '> 潜在客户 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "联络人 ")
{
TableBody = TableBody + " <td width= '60 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= '../EvectionReportData/Test.aspx ' target= 'mainFrame ' onmousedown= 'javascript:Click(this); '> 联络人 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "竞争者 ")
{
TableBody = TableBody + " <td width= '55 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= '../Email/SendEmail.aspx ' target= 'mainFrame ' onclick= 'javascript:Click(this); '> 竞争者 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "商机 ")
{
TableBody = TableBody + " <td width= '55 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= '../EvectionReportData/EvectionReport.aspx ' target= 'mainFrame ' onfocus= 'javascript:Click(this); '> 商 机 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "报价 ")
{
TableBody = TableBody + " <td width= '69 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href= '../Order/Default.aspx ' target= 'mainFrame ' onfocus= 'javascript:Click(this); '> 报 价 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "服务需求 ")
{
TableBody = TableBody + " <td width= '55 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Control/BroadCast .aspx ' target= 'mainFrame '> 服务需求 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "活动 ")
{
TableBody = TableBody + " <td width= '60 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Question/UserCreate.aspx ' target= 'mainFrame '> 活 动 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "行事历 ")
{
TableBody = TableBody + " <td width= '69 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Competor/Default.aspx ' target= 'mainFrame '> 行事历 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "电子邮件 ")
{
TableBody = TableBody + " <td width= '69 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Order/Product.aspx ' target= 'mainFrame '> 电子邮件 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "员 工 ")
{
TableBody = TableBody + " <td width= '55 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Film/Orderform.aspx ' target= 'mainFrame '> 员工 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "资讯中心 ")
{
TableBody = TableBody + " <td width= '69 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Film/UserID.aspx ' target= 'mainFrame '> 资讯中心 </a> </td> ";
}
if (ds.Tables[0].Rows[i][1].ToString() == "训息广播 ")
{
TableBody = TableBody + " <td width= '69 ' valign= 'middle ' align= 'center ' height= '15 ' style= 'background-image: url(images/Button3.gif) ';> <a href = '../Film/UserID.aspx ' target= 'mainFrame '> 训息广播 </a> </td> ";
}
}
int r = ds.Tables[0].Rows.Count;
int t = 850 - (r + 2) * 69;
string s = " <td width= ' " + t + " ' style= 'background-image: url(../images/ind-cityviewbg.gif) '> </td> ";
TableBody = TableBody + s;
return TableBody;
}
我想实现如果td多的一行放不下的话,点像左移的image第一个td就像左移动。移到看不见,第二个td排第一,在点左移的image第二个也跟着第一个移动到看不见,第三个排第一个,同样的点右边移动的image的话就往移动。请问该怎么做。如果一行tr放的下所有的td则移动会没有反应。因为我不同的权限登陆系统,返回的TD不同。
[解决办法]
专业顶贴!!
[解决办法]
网上有通过js来实现的例子你可以去搜索一下
[解决办法]
帮顶了!lz真的该考虑用js实现
[解决办法]
帮顶,加油!
[解决办法]
这个你真的应该发到起JS版去,那里的meizz是高手
[解决办法]
关注高手发言......