Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
硬编码一个表格,其中一个单元格显示 R max并带有“max”作为下标。
TableCell c = new TableCell(); c.Text = "R<sub>max</sub>";
但是结果被渲染为 R< sub >max< /sub > (没有空格 - 抱歉,糟糕的循环阻止它在这篇文章中渲染)
正确的文字,错误的渲染。另外,我想使用 CSS 来控制字体等。
尝试
c.Text = "R<sub>max</sub>"
更新:
string html = "R<sub>max</sub>"; html = System.Web.HttpUtility.HtmlDecode(html); Response.Write(html);