2017.10.11 string.Format字符串格式说明和 单元格合并行和并列Clospan rowspan

分享人:王灏


1. string.Format字符串格式说明

http://www.cnblogs.com/lgx5/p/6192705.html

  • string.Format("{0:D3}",23) 结果为:023
    string.Format("{0:D2}",1223) 结果为:1223,(精度说明符指示结果字符串中所需的最少数字个数。)

  • 用分号隔开的数字,并指定小数点后的位数
    string.Format("{0:N}", 14200) 结果为:14,200.00 (默认为小数点后面两位)
    string.Format("{0:N3}", 14200.2458) 结果为:14,200.246 (自动四舍五入)

  • 日期格式化
    string.Format("{0:d}",System.DateTime.Now) 结果为:2009-3-20 (月份位置不是03)
    string.Format("{0:D}",System.DateTime.Now) 结果为:2009年3月20日
    string.Format("{0:f}",System.DateTime.Now) 结果为:2009年3月20日 15:37
    string.Format("{0:F}",System.DateTime.Now) 结果为:2009年3月20日 15:37:52
    string.Format("{0:g}",System.DateTime.Now) 结果为:2009-3-20 15:38
    string.Format("{0:G}",System.DateTime.Now) 结果为:2009-3-20 15:39:27
    string.Format("{0:m}",System.DateTime.Now) 结果为:3月20日
    string.Format("{0:t}",System.DateTime.Now) 结果为:15:41
    string.Format("{0:T}",System.DateTime.Now) 结果为:15:41:50


2. 单元格合并行和并列Clospan rowspan

1.1.png
1.2.png
2.png

1.1

protected Model.Tech_Passport[] passportCode = DB.Tech_Passport.getAll();
public Model.Tech_Passport tps = new Model.Tech_Passport();
  1. 2
tps = passportCode.Where(x => x.P_CODE == ci.P_CODE).ToArray().Length == 0 ? new LoongAir.Model.Tech_Passport() : passportCode.Where(x => x.P_CODE == ci.P_CODE).ToArray()[0];
tps = passportCode.Any(x => x.P_CODE == ci.P_CODE) ? passportCode.Where(x => x.P_CODE == ci.P_CODE).ToArray()[0] : new LoongAir.Model.Tech_Passport();
tps = passportCode.Any(x => x.P_CODE == ci.P_CODE) ? passportCode.FirstOrDefault(x => x.P_CODE == ci.P_CODE) : new LoongAir.Model.Tech_Passport();

2

  <thead>
            <tr style="background-color: rgb(240,245,247)">
                <td rowspan="2">姓名</td>
                <td colspan="2">国际护照</td>
                <td colspan="2">港澳通行证</td>
                <td colspan="2">入台许可证</td>
                <td colspan="2">大陆通行证</td>
                <td rowspan="2">资质详情</td>
            </tr>
            <tr style="background-color: rgb(240,245,247)">
                <td>签发日期</td>
                <td>失效日期</td>
                <td>签发日期</td>
                <td>失效日期</td>
                <td>签发日期</td>
                <td>失效日期</td>
                <td>签发日期</td>
                <td>失效日期</td>
            </tr>
        </thead>

一些健身达人

image.png
image.png
image.png
image.png
image.png
image.png
image.png
image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • longaaaa =14200666; Console.WriteLine(aaaa.ToString("N0")...
    鱼落于天阅读 4,451评论 0 1
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,323评论 19 139
  • 本文转载自:http://blog.csdn.net/lonely_fireworks/article/detai...
    NeWolf阅读 3,382评论 0 1
  • 1. Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语...
    子非鱼_t_阅读 31,899评论 18 399
  • 相关概念: 1.代数系统:元素与函数的组合 2.函数是一种关系 3.群是一个二元代数系统 4.图是表达一个集合上二...
    Yuliet阅读 3,465评论 0 0