Where I am using the div class, there is a line-break after every if statement and the rows are not in alignment.
How can I correctly align the php output, so both rows is horizontal aligned.
function display_selected_variation_custom_field_js(){
?>
<script type="text/javascript">
(function($){
var a = '.custom_variation-text-field', b = $(a).html();
$('form.cart').on('show_variation', function(event, data) {
outputHtml = '';
if( data.model ) {
outputHtml += '<div align="left"> <span><strong><?php _e("Model"); ?><strong>: '+data.model+'<span></div>';
}
if( data.wattage ) {
outputHtml += '<div align="center"><span><strong><?php _e("Wattage"); ?><strong>: '+data.wattage+'<span></div>';
}
if( data.lumen ) {
outputHtml += '<div align="right"><span><strong><?php _e("Lumen"); ?><strong>: '+data.lumen+'<span></div>';
}
if( data.material ) {
outputHtml += '<div align="left"><span><strong><?php _e("Material"); ?><strong>: '+data.material+'<span></div>';
}
if( data.dimension ) {
outputHtml += '<div align="center"><span><strong><?php _e("Dimension"); ?><strong>: '+data.dimension+'<span></div>';
}
if( data.year ) {
outputHtml += '<div align="right"><span><strong><?php _e("Year"); ?><strong>: '+data.year+'<span></div>';
}
if( outputHtml ) {
$(a).html(outputHtml);
}
}).on('hide_variation', function(event) {
$(a).html(b);
});
})(jQuery);
</script>
Current Output:

