代码之家  ›  专栏  ›  技术社区  ›  Jaco Pretorius

如何将CSS类应用于htmlTableCell?

  •  8
  • Jaco Pretorius  · 技术社区  · 15 年前

    我正在使用webforms。 HtmlTableCell 没有 CssClass 属性。我可以这样做:

    <td class="whatever"></td>
    

    但不是这样:

    myTableCell.Class = "whatever";
    

    如何将CSS类应用于 HTML表格单元格 ?

    2 回复  |  直到 15 年前
        1
  •  19
  •   Jaco Pretorius    15 年前

    知道了。

    myTableCell.Attributes.Add("class", "whatever");
    
        2
  •  1
  •   Eduardo Pelais    9 年前

    属性属性也适用于CSS样式。

    例如:

    myTableCell.Attributes.Add("style", "height: 30px; border: 1px solid;")