Render HTML through shortcode

Formidable Forms
23 February, 2024 04:27:54
nati
Topics: 1
Messages: 2
Hello, I have this code and I want to render an ul element which i wish to style with display: flex etc. The code:
function combine_and_format_values() {
// Add the default values
$default_values = array('אח.ות', 'דוד.ה', 'סבא. סבתא');

// Get the dynamic value from the form field
$dynamic_value = FrmProEntriesController::get_field_value_shortcode(array('field_id' => 1942, 'user_id' => 'current'));

// Split the dynamic value into an array
$dynamic_values_array = explode(',', $dynamic_value);

// Combine the default and dynamic values
$combined_values = array_merge($default_values, $dynamic_values_array);

// Format the values into an HTML unordered list
$html_output = '<ul>';
foreach ($combined_values as $value) {
$html_output .= '<li>' . $value . '</li>';
}
$html_output .= '</ul>';

return $html_output;
}

add_shortcode('combined_values', 'combine_and_format_values');

I have default and dynamic values, when i insert this to either html or textarea it converts to spans.
In the attached file is the look i wish to achieve by styling this.
23 February, 2024 05:40:08
E2Pdf
Support
Topics: 7
Messages: 3331
Hello,

Unfortunately, E2Pdf doesn't support "flex" css. As an option, you can try to generate designed output via "table":

https://codefile.io/f/8ywWjLy8pP
We would really appreciate your feedback at WordPress.org!
23 February, 2024 05:47:45
nati
Topics: 1
Messages: 2
Ty, that worked perfectly. I literally just started using the table before your answer :)