Tabular Input HTML table exceeds container div

Hi, I am fairly new to web development, and forgive me for asking what could be a simple problem.

I have used a HTML table to display my tabular input as shown here http://www.yiiframework.com/doc/guide/1.1/en/form.table . However, the table is exceeding the width of the container div. I have a couple of activedropdowns in each table row and I think this is causing the problems as it has a ‘minimum width’ which is stretching the table.

What I would like is to be able to shrink the table to fit within the container div, similar to CGridView in the default admin pages.

Thanks.

You may tune your CSS like this:

  • First, set your table “width” to something (I use generally 100% but it’s up to you — you can specify a width in px)

  • Set your table "table-layout" css property to "fixed"

  • Set your column(s) width to what you want (in px, or in % for instance)

  • Set your column "overflow-x" css property to "hidden", "auto", or "scroll" depending on your needs

I’d say play with the CSS settings, and you’re stuck, please post your codes :)

Hi, thanks for your reply.

In the end, what I did was to specify the width of each of the required dropdownlists by setting the $htmloptions parameter.