Home > Web Front-end > HTML Tutorial > CSS text superscript and subscript_html/css_WEB-ITnose

CSS text superscript and subscript_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:47:27
Original
1328 people have browsed it

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;        }
Copy after login



The above code is mainly to obtain 3 values, strs[0]=759 strs[1]= 0.6 strs [0]=-0.4 This is used to display up and down



??

??

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template