Questions about number formatting in Excel documents Excel drop-down menu what to do excel2013 official download excel2007

Source: Internet
Author: User
Tags closing tag
when we putWeb the data on the page leads toExcel form, sometimes our data needs to be presented in a specific format, and we need to giveCell Add some style specification information.

first, let's look at how Excel derives from Web pages. When we send this data to the client, we want to have the client program (the browser) read it in Excel format, so we set the MIME type to:application/vnd.ms-excel, when when Excel reads a file , it renders the data in the format of each cell , and if the cell does not have a specified format, Excel renders the cell in its default format the data. This gives us the space to customize the data format, and of course we must use the format supported by Excel. Here's a list of some commonly used formats:

1) text:vnd.ms-excel.numberformat:@

2) Date:vnd.ms-excel.numberformat:yyyy/mm/dd

3) number:vnd.ms-excel.numberformat: #,# #0. xx

4) Currency:vnd.ms-excel.numberformat:¥#,# #0. XX

5) percent:vnd.ms-excel.numberformat: #0.00%

These formats you can also customize, such as the year you can be defined as:yy-mm and so on. So what do you know about these formats and how do you add them to the cell ? Very simply, we just need to add the style to the corresponding label pair (that is, the closing tag). For example , add a style to the label pair , as follows:

< TD style =" vnd.ms-excel.numberformat:@ " > 410522198402161833 td>


Also, we can add styles or give them ,

add a style that will introduce a problem, do you notice? Let's look at the following code:

< Table style = ' vnd.ms-excel.numberformat:#,# #0. xx ' >
<tr>
<td>542 td>
<TD style= ' Vnd.ms-excel.numberformat: #0.00% ' > 0.25 td>
tr>
Table >

The above describes the Excel document in the digital format of the problem, including the content of Excel, I hope that the PHP tutorial interested in a friend to help.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.