TABLE COLUMN FIXED WIDTH

Takeshi Okada

Total Post:89

Points:629
Posted by  Takeshi Okada
 1375  View(s)
Ratings:
Rate this:
Hi Everyone!

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

http://jsfiddle.net/Stylock/jJ6DK/

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. AVADHESH PATEL

    Post:604

    Points:4228
    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. Vijay Shukla

    Post:100

    Points:700
    Re: Table column fixed width

    Hi Takesh!

    Remove table-layout: fixed from table:

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!