Finish a column

Support MB Columns Finish a column

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1084
    closemarketingclosemarketing
    Participant

    Hello, I'm using columns -> 4, but if i have less fields and I want to break with a divider, it goes to the column. I want to make like clear: both; Is it possible?

    #1087
    Anh TranAnh Tran
    Keymaster

    An easy way to do that is keep adding 4 fields for columns, but you can use a special field like custom_html with zero content. That forces the plugin to output empty divs in the column which helps to maintain the layout.

    #1098
    closemarketingclosemarketing
    Participant

    Why don't you make divider to clear floats?

    #1100
    Anh TranAnh Tran
    Keymaster

    It does have clear floats, of course. But the thing is the plugin needs correct number of columns to output correct opening and closing divs. You can see it in the console like this:

    Here is an example to illustrate what I meant in previous reply: assuming we have 2 rows, 1st row has 2 fields (each field has 1/4 width), 2nd row has 4 fields (each field has 1/4 width):

    add_filter( 'rwmb_meta_boxes', function ()
    {
    	return [
    		[
    			'title'  => 'Demo columns',
    			'fields' => [
    				[
    					'id'      => 'text1',
    					'type'    => 'text',
    					'name'    => 'Text1',
    					'columns' => 3,
    				],
    				[
    					'id'      => 'text2',
    					'type'    => 'text',
    					'name'    => 'Text2',
    					'columns' => 3,
    				],
    				[
    					'type'    => 'custom_html',
    					'std' => '',
    					'columns' => 6,
    				],
    				[
    					'id'      => 'text5',
    					'type'    => 'text',
    					'name'    => 'Text5',
    					'columns' => 3,
    				],
    				[
    					'id'      => 'text6',
    					'type'    => 'text',
    					'name'    => 'Text6',
    					'columns' => 3,
    				],
    				[
    					'id'      => 'text7',
    					'type'    => 'text',
    					'name'    => 'Text7',
    					'columns' => 3,
    				],
    				[
    					'id'      => 'text8',
    					'type'    => 'text',
    					'name'    => 'Text8',
    					'columns' => 3,
    				],
    			],
    		]
    	];
    } );
    #1103
    closemarketingclosemarketing
    Participant

    Thanks Ahn.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Finish a column’ is closed to new replies.