Raekye Raekye - 5 days ago 5
CSS Question

Make HTML table columns fixed width (and stretch to fit)

I'm trying to make a calendar, and I've got it mostly working except I want to space it out a bit. I tried setting the table to

width: 210px
and
table-layout: fixed
so it'd work like this, but I can't seem to get it worked. Here is the jsFiddle; when I set the width to 210px it just slides the table over. Fixed doesn't seem to do anything.

How can I set the column width to stretch to fit (and evenly spaced).

Answer

Try removing display: inline-block from the table#cal styling.

http://jsfiddle.net/ELpS8/1/

Comments