Forum


Replies: 3   Views: 2394
Checkboxes with embedhtml
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by lucaloda  · 13-12-2018 - 14:42

in my final document i get some checkbox bigger than the other.

i set font-size of all table to 7pt but some of them have 7pt, others 11pt.

 

is there a way to edit the size of the checkboxes while using embedHTML?

Posted by admin  · 14-12-2018 - 07:56

Hello,

Checkboxes can be styled using paragraph styles. We have done some tests and everything is working correctly.

We recommend you to check your code, maybe some unwanted style is being applied or you are trying to apply not paragraph styles to checkboxes. You can also change checkbox styles using DOCXCustomizer, but it's only available in Premium licenses.

Regards.

Posted by lucaloda  · 14-12-2018 - 15:29

it seems not to work. the style is as such:

 

<style>

body { width: 100% !important; line-height: 200%; text-align: justify; text-justify: inter-word; font-size:12pt; }

img { width: 610pt; }

table { width: 100% !important; line-height: 120% !important; max-width: 100% !important; font-size: 7pt !important; text-align: center; }

table p { height: 7pt !important; }

table, th, td { border: 0 solid white; border-collapse: collapse; }

tbody tr:first-child td { background-color: #4BABC6; color: white; text-transform: uppercase; }

tbody tr:nth-child(even) { background-color: #DEF6F7 }

.tabella th, .tabella td { padding:10px; }

.tabella tbody tr td:nth-child(2) { text-align: center; width: 100px; }</style>"

Posted by admin  · 14-12-2018 - 16:36

Hello,

Sorry, we think we have not explained the solution properly. You can't use CSS styles, because styling checkboxes through CSS isn't supported. You need to use MS Word styles, and this style needs to be applied to the whole paragraph to set checkbox font-sizes. On https://www.phpdocx.com/documentation/introduction/html-to-word-PHP (section Using native Word formatting with HTML) you can read some samples about how to use MS Word styles when importing HTML contents.

We have moved the request to the dev team to add support for font-size and other rPr styles to checkboxes using HTML/CSS in the next release of phpdocx.

Regards.