首頁 >web前端 >html教學 >CSS 文本上下标_html/css_WEB-ITnose

CSS 文本上下标_html/css_WEB-ITnose

WBOY
WBOY原創
2016-06-24 11:47:271346瀏覽

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