# How to assign width=100% to table cells?

**URL:** <https://www.ruby-forum.com/t/how-to-assign-width-100-to-table-cells/70183>\
**Category:** Ruby-Gnome 2\
**Created:** [September 27, 2006, 11:40am UTC](https://www.ruby-forum.com/t/how-to-assign-width-100-to-table-cells/70183 "2006-09-27T11:40:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@Dobai-Pataky\_B](https://www.ruby-forum.com/u/Dobai-Pataky_B)\
**Post date:** [September 27, 2006, 11:40am UTC](https://www.ruby-forum.com/t/how-to-assign-width-100-to-table-cells/70183/1 "2006-09-27T11:40:30Z")

</div>

Hi,

i have a Gtk::Table(5,3), with buttons in it - the keypad.  
i want thise buttons to be as large as possible,  
i walked through the documentation on size requisition and allocation,  
and came to the conclusion that Gtk is concentrating on making widgets  
as small as possible, which is good generally, but not for me not in  
this issue.

my buttons are as small as they can be, i attached them to the table  
like this: attach(‘1’,0,1,0,1,Gtk::FILL, Gtk::FILL, 0, 0), so they fill  
in the table’s cell, i like this,  
the table is defined as new(5,3,true)  
no matter if i table.set\_size\_request(700.900), i get the table big  
enough, but not the buttons.

so is there a way i can tell Table to require Width, and assuming i  
have created it to be homogeneous, it should divide it’s children not  
just equally, but taking up all the space?

since my table has 3 columns, my third button is attached like  
(widget,2,3,0,1…) , i guess that’s correct even if there is no 4th  
column indexed as 3 in the table(since it starts from 0), so the widget  
is right - attached to a non existent column.

I’d appreciate any suggestion,

thanks

Balint

---

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@Dobai-Pataky\_B](https://www.ruby-forum.com/u/Dobai-Pataky_B)\
**Post date:** [September 27, 2006, 1:50pm UTC](https://www.ruby-forum.com/t/how-to-assign-width-100-to-table-cells/70183/2 "2006-09-27T13:50:43Z")

</div>

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys – and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
