Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table width 100%. 1 column fixed width

Tags:

css

here is the code i'm having a problem with:

http://jsfiddle.net/crptS/

Basically I have a table, and the width of the table is 100%

table
{
 border: 1px solid #ffda95;
  border-collapse: collapse;
  width: 100%;
}

now I have 1 column which contains 3 icons and I dont want this column to scale with the page. it should have a width of 25px. the td has the class tdmaxwidth60

.tdmaxwidth60
{
    width: 25px;
    min-width: 25px;
    max-width: 25px;
}

however. in Firefox and IE this column still scales with the page, be it slightly different than in jsFiddle. it looks like the width is working (on load width is correct) and the min-width too works, when you have the page fullscreen and you make it smaller it stays the same width. however when you load the page on a small page and then make it fullscreen the width of the column does stretch.

any ideas how to fix this?

like image 407
Stefanvds Avatar asked Feb 24 '26 16:02

Stefanvds


1 Answers

In the jsfiddle you posted 4 columns have fixed widths. Therefor they all scales to suit that width of the table.

If you only set the width of the first column then the other columns will scale to fit. And the first column will stay the same.

like image 150
Petah Avatar answered Feb 27 '26 08:02

Petah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!