HTML to Excel: How can tell Excel to treat columns as numbers?

前端 未结 7 997
半阙折子戏
半阙折子戏 2020-12-04 18:42

I need to achieve the following when opening an HTML in Excel (Response.contentType=\"application/vnd.ms-excel\") :

  • force Excel to consider conten
7条回答
  •  生来不讨喜
    2020-12-04 18:46

    It doesn't works sometimes if you add it using a css class in that case try it using in Style to your TD. I did it for formatting a column to a text. like this

     style="mso-number-format:\@;"
    

    For you it would be as

      mso-number-format:General
    

提交回复
热议问题