Firstly, in your doctype, shift the ‘float’ row before the column break so that it aligns right below the data row. Next, use jquery to select the css element i.e css selector for ‘float’ and apply a padding to it in the doctypes js file.
Thank you. I think your approach is more a hack than a solution. I think there should be a fieldtype to start a new section body / section row.
My solution is different. I just built it with a seperate section break, as I would do without any hacks. Then I moved its contents via jquery to the other .section-body and deleted the empty section row.
With this logic you can easily add as many “row breaks” as you like.
It’s obviously still a hack and I would love to see a native implementation of row breaks as fields in doctypes.
On that note, is there a request done for that functionality? I tried to find it but couldn’t.
EDIT: I had to add a condition to the function that tests if the source is already in the same form section as the target. That’s because the refresh event is triggered when saving the document but without reloading the page, so it broke the format.
function addRowBreak(source,target){
var form_section1 = $('[data-fieldname="' + source + '"]').closest('.form-section');
var form_section2 = $('[data-fieldname="' + target + '"]').closest('.form-section');
if (form_section1.get(0) != form_section2.get(0)){
form_section1.find('.section-body').appendTo($('[data-fieldname="' + target + '"]').closest('.section-body'));
form_section1.remove();
}
}