首页  >  文章  >  web前端  >  CSS 文本上下标_html/css_WEB-ITnose

CSS 文本上下标_html/css_WEB-ITnose

WBOY
WBOY原创
2016-06-24 11:47:271306浏览

public string GetHtml(object obj)        {            string result = "";            System.Text.RegularExpressions.Regex regex = new System.Text.RegularExpressions.Regex("{.*,.*,.*}");            string matchResult = regex.Match(obj.ToString()).ToString();            if (string.IsNullOrEmpty(matchResult))            {                result = obj.ToString();            }            else            {                string[] strs = matchResult.Replace("{", "").Replace("}", "").Split(',');                result = "<table style=\"padding:0px;margin:0px;line-height: 4px;border:none;border-width:0px;\"><tr>";                result += "<td style=\"padding:0px;margin:0px;text-align: right;width:50%; line-height: 10px;border:none;border-width:0px;\" rowspan=\"2\"><span>" + strs[0] + "</span></td>";                result += "<td style=\"padding:0px;margin:0px;text-align: left; line-height: 10px;border:none;border-width:0px;\"><span style=\"vertical-align:super; color:red; font-size:9px; font-family:Arial, Helvetica, sans-serif;margin:10px 0px 0px 0px\">" + strs[1] + "</span></td></tr>";                result += "<tr><td style=\"padding:0px;margin:0px;text-align: left;line-height: 10px;border:none;border-width:0px;\"><span style=\"vertical-align:sub; color:red; font-size:9px; font-family:Arial, Helvetica, sans-serif;margin:10px 0px 0px 0px\">" + strs[2] + "</span></td></tr></table>";            }            return result;        }



以上代码主要是为了获取3个值,  strs[0]=759   strs[1]=+0.6   strs[0]=-0.4  这样用来显示上下 



??

??

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn