mohammad qasim

mohammad qasim

  • NA
  • 408
  • 0

border not showing export Html to word

Apr 28 2020 3:19 PM
Hi,
 
I am exporting Html table into Doc.
 
Eporting fine, but format is not like as I design on html.
 
Html Look
 
 
 
After exporting showing like this
 
 
 
My Code
  1. <table id="tblexportword" border="1" style="width: 100%;">  
  2. </table>  
  3. <button class="ExportToWord">Export To Word(.doc) </button>  
  4. <script type="text/javascript">  
  5. $(function () {  
  6. $(".ExportToWord").click(function (event) {  
  7. $("#tblexportword").wordExport();  
  8. });  
  9. });  
  10. function GenerateWordFile(response) {  
  11. var nomenSplit = response[0]["Nomenclature"].split('/');  
  12. var row = "<tr> <td colspan='3' style='border:10px;text-align: center;'>" + response[0]["Nomenclature"] + "</td></tr>";  
  13. row += "<tr> <td colspan='3' style='text-align: center;'>" + response[0]["Title"] + "</td></tr>";  
  14. row += "<tr> <td rowspan='6' style='width:60%'> SEARLE </td> <td> Company Code </td> <td>" + nomenSplit[0] + "</td> </tr>";  
  15. row += "<tr> <td> Plant Code </td> <td> " + nomenSplit[1] + "</td> </tr> ";  
  16. row += "<tr> <td> Document # </td> <td> " + response[0]["Nomenclature"] + "</td></tr> ";  
  17. row += "<tr> <td> Superseded # </td> <td> " + response[0]["OldsopName"] + "</td></tr> ";  
  18. row += "<tr> <td> Created Date </td> <td> " + response[0]["Created"] + "</td></tr> ";  
  19. row += "<tr> <td> Review Date </td> <td> " + response[0]["Nomenclature"] + "</td></tr> ";  
  20. $('#tblexportword').append(row);  
  21. $("#tblexportword").wordExport();  
  22. }  
  23. </script>  
Kindly help to export it ,based on Html Layout ( with Border )
 
Thanks

Answers (3)