StringBuilder拼串和绘制表格的效果
2017-06-20 11:35:10 访问(1738) 赞(0) 踩(0)
/// <summary>
///
/// </summary>
/// <param name="theResult"></param>
/// <param name="isEnd"></param>
protected void PrintHtmlTable(StringBuilder theResult, bool isEnd)
{
if (isEnd)
theResult.AppendLine("</table>");
else
theResult.AppendLine("<table border=\"1\">");
}
/// <summary>
///
/// </summary>
/// <param name="theResult"></param>
/// <param name="isEnd"></param>
protected void PrintHtmlTr(StringBuilder theResult, bool isEnd)
{
if (isEnd)
theResult.AppendLine("</tr>");
else
theResult.AppendLine("<tr>");
}
/// <summary>
///
/// </summary>
/// <param name="theResult"></param>
/// <param name="strLeft"></param>
/// <param name="leftStyle"></param>
/// <param name="strRight"></param>
/// <param name="rightStyle"></param>
protected void PrintHtmlTd(StringBuilder theResult, string strLeft, string leftStyle, string strRight, string rightStyle)
{
theResult.AppendLine("<td " + leftStyle + ">" + strLeft + "</td>");
theResult.AppendLine("<td " + rightStyle + ">" + strRight + "</td>");
}
/// <summary>
///
/// </summary>
/// <param name="theResult"></param>
/// <param name="strLeft"></param>
/// <param name="strRight"></param>
protected void PrintHtmlTd(StringBuilder theResult, string strLeft, string strRight)
{
theResult.AppendLine("<td>" + strLeft + "</td>");
theResult.AppendLine("<td>" + strRight + "</td>");
}
上一条:
下一条:
相关评论
发表评论