Hello!
I am working in a software that generates a word. Now, I am trying to embeded some HTML content in a Word file. This solution is based on SharePoint Online and some other libraries that replaces some words with these kind of HTML content.
For some reason, HTML tables adds some spacing in the bottom (like padding-bottom).
This is an example of the HTML code that is embeded in the result Word file. Please, note that I tried using old HTML tags and newer CSS attributes (margin and height)
<table style='width: 100%; height: 10px;' height='20' border='1' cellpadding='0' cellspacing='0' ><tr style='height: 2px;'><th style='color: #FFFFFF;margin: 0px; background-color: #C10C1E; border: 1px black solid;height: 2px;'>Title</th><th style='color: #FFFFFF;margin: 0px; background-color: #C10C1E; border: 1px black solid;height: 2px;'>% Complete</th><th style='color: #FFFFFF;margin: 0px; background-color: #C10C1E; border: 1px black solid;height: 2px;'>Planned Finish Date</th></tr><tr style='height: 2px;'><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>Example</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>100%</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>20/12/2019</td></tr><tr style='height: 2px;'><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>Example</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>70%</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>20/01/2020</td></tr><tr style='height: 2px;'><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>Example </td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>100%</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>24/01/2020</td></tr><tr style='height: 2px;'><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>Example</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>100%</td><td style='height: 2px; margin: 0px; vertical-align:top; border: 1px black solid; white-space: pre;'>27/01/2020</td></tr></table>
This is more or less how it looks on a HTML page:
Title | % Complete | Planned Finish Date |
---|---|---|
Example 1 | 100% | 20/12/2019 |
Example 2 | 100% | 20/01/2020 |
Example 3 | 100% | 24/01/2020 |
Example 4 | 100% | 27/01/2020 |
Then, in word it looks like this (Please note the padding in the bottom):
Image may be NSFW.
Clik here to view.
When I go to Table Properties in Word, I see these options. Then I need to check the row height as exactly to have the expected result.
Image may be NSFW.
Clik here to view.
After do it, the result in Word is this:
Image may be NSFW.
Clik here to view.
I would like to know how to force the height of each row (as Word does) using embbeded HTML
Thank you!