0

I've created my own adminhtml grid for a module and was wondering if somebody could point out how I can adjust the width of the whole grid itself? (I.E to only utilize 80% of the page width).

Please note that I am not asking how to change the column width, but the % of the page that the grid's width will occupy.

Thanks in advance.

P.S I've got a feeling it will be in the Grid.php file?

class Namespace_Module_Block_Adminhtml_Custom_Grid extends Mage_Adminhtml_Block_Widget_Grid


public function __construct(){
parent::__construct();
#Somewhere here?
}

0

You can do that from css.
Add to your grid page a custom css file with this line:

#ID_OF_GRID {width:80%}

Use firebug, or view source to see the value for ID_OF_GRID.
Usually the id is the value you set in the grid constructor using:

$this->setId('...');
  • Thanks, excellent solution. Could you please indicate to me what your preferred way of adding custom css? I went the route of <action method="addCSS"> in the layout.xml file of mine. – Moose Nov 20 '13 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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