I have created a custom configuration same like Magento\Braintree\Block\Adminhtml\Form\Field\Countrycreditcard.php with some fields like

            ['label' => __('Field'), 'renderer' => $this->_getAttributesRenderer(),'style' => 'width: 1000px']

Even if i set width in style its not working.

Please let me know how to set width.

  • @Marius Did you get the chance to look on this Feb 11, 2016 at 13:15

2 Answers 2



Magento\Braintree\Block\Adminhtml\Form\Field\Cctypes.php` `_toHtml



So with same function try to set width


setExtraParams function accepts any styling or other attributes we can set for select field


I was using this Magento\Framework\Data\Form\Element\Factory class to generate element and I've added below code and it worked for me.

$element = $this->_elementFactory->create('select');
$regions = $this->regionOptions->toOptionArray();
            $this->_getCellInputElementId('<%- _id %>', $columnName)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.