Table column fixed width

Total Post:89

 1701  View(s)
Rate this:
Hi Everyone!

I'm having problems with setting a fixed width for table columns. Have a look at jsfiddle example:

The middle column should be 300px wide, and the left column should be 80px wide, but for some reason all three columns are the same width. Anyone knows how 

to fix that?

Thanks in advance!
  1. Post:604

    Re: Table column fixed width

    Hi Takeshi!

    Remove this css style of your table and it should work:

    table-layout: fixed;

    When you set table-layout: fixed for you table it will take these algorithms:

    The horizontal layout only depends on the table's width and the width of the columns, not the contents of the cells
    Allows a browser to lay out the table faster than the automatic table layout
    The browser can begin to display the table once the first row has been received

  1. Post:100

    Re: Table column fixed width

    Hi Takesh!

    Remove table-layout: fixed from table:

    table {
        border: 1px solid #D7E4B9;
        background: #B4CDCD;