2/1/2023
The Why
A plain HTML content control is fine on its own, but its best when other content is added into it. For this example the previous post on creating HTML content will be used as a baseline.
The How
The end result of this will look like this
To get the text to center both in the X and Y, I will use a HTML table for the text to live in.
"<div style='border-radius:12px 12px 0px 0px; width:560px; height:100px; background-color:#E5EFFE'>
<table
style='width:100%; class: center; vertical-align: middle; height: 100%; width: 100%'>
<th>Hello World!</th>
</div>"
The “<div style='border-radius:12px 12px 0px 0px; width:560px; height:100px; background-color:#E5EFFE'>” creates the light blue box and shapes it.
The “<table style='width:100%; class: center; vertical-align: middle; height: 100%; width: 100%'>” creates the table style and centers it.
The <th>Hello World!</th> is the text inside of an HTML Table Header
The </div>" closes out the HTML
💡 All HTML inside of a Power App must be opened and close with a “”. Any “” in between needs to be replaced with a ‘’.