我如何在此代码中使用Css类 [英] how do I use Css class in this code

查看:71
本文介绍了我如何在此代码中使用Css类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我有这样的代码:

Hi every one i have code like this:

string  soluitiontitle = "<tr><td rowspan="\""">" + (++RowItem).ToString() + "</td><td>" + SolutionName;
                 soluitiontitle += "</td><td>" + queryorderitem.ToArray()[0].NumberSolutionitem.ToString() + "</td>" + "<td></td><td rowspan="\""">" + TotalCost.ToString() + "</td></tr>";
                 Tablecontent += soluitiontitle + producttable;

             }
             Literal1.Text = Tablecontent;



我想要使用Css类init,每个td都有border-left和border right,每个tr都有border-below和border-top

如何在此代码中使用css;


And i want use Css class init that every td have border-left and border right and every tr have border-below and border-top
how can do this that use css in this code;

推荐答案

http://stackoverflow.com/questions/6344152/how-to-set-css-properties-to-dynamically-created-table [ ^ ]



http://stackoverflow.com/questions/6344152/how-to-set-css-properties-to-dynamically-created-table[^]

string  soluitiontitle = "<tr class="yourCSSClass"><td rowspan="\""">" + (++RowItem).ToString() + "</td><td>" + SolutionName


使用这种方式 -



use this way-

string  soluitiontitle = "<table><tbody><tr>  class='init'  ><td rowspan="\">" + (++RowItem).ToString() + "</td><td>" + SolutionName;
                  soluitiontitle += "</td><td>" + queryorderitem.ToArray()[0].NumberSolutionitem.ToString() + "</td>" + "<td></td><td rowspan="\">" + TotalCost.ToString() + "</td></tr></tbody></table>";
                  Tablecontent += soluitiontitle + producttable;

              }
              Literal1.Text = Tablecontent;





如果有帮助则标记答案。



mark answer if helped.


这篇关于我如何在此代码中使用Css类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆