Do you have an another solution instead of using <br>?
-
This reply was modified 8 years, 7 months ago by
qba123.
Hi,
in addition to my basic code example on https://ww.wp.xz.cn/plugins/advanced-custom-fields-table-field/, you can add the PHP nl2br() function to the cell content to convert the native line breaks from the table cell editor into <br> tags.
echo nl2br( $td['c'] );
Cheers,
Johann
To display natural line breaks at the editing tables in the admin area, add the following styles to the admin area.
.acf-table-header-cont,
.acf-table-body-cont {
white-space: pre-line;
}
One way to add these styles to the WordPress admin area is adding the following code to your functions.php file of the theme.
add_action('admin_head', 'acf_table_styles');
function acf_table_styles() {
echo '<style>
.acf-table-header-cont,
.acf-table-body-cont {
white-space: pre-line;
}
</style>';
}