Retain HTML table styling after exporting to excel using javascript/jquery

后端 未结 1 556
-上瘾入骨i
-上瘾入骨i 2020-12-31 09:51

I have a beautiful looking html table from jsfiddle which i will love to convert to excel document. My problem is after creating the excel file. The table loses it styles in

相关标签:
1条回答
  • 2020-12-31 10:27

    Finally I figured it out. Using an embedded or external CSS style will not work.

    Observations

    1. CSS must be inline
    2. CSS must be on th or td elements of the table because they represent cells in Excel
    3. Colors should be hex

    Summary

    From the above code, I don't need an external CSS style. All my CSS styles need to be inline in the table.

    0 讨论(0)
提交回复
热议问题