Jump to content

layout with tables


chadmichael
 Share

Recommended Posts

I am using tables for layout. I have trouble getting the cells to actually respond to the widths that I set. I seems that the cells are disregarding the widths I set for them and just resizing to match the cell widths set in cells at the top of the columns. Can anyone explain what is happening here and how to fix it.Thanks,Chad

Link to comment
Share on other sites

some browsers will do this - so make sure your width is set in your <table> and your <td> or <th>. Then make sure the last thing you do in any <td> or <th> is place a <br> there - it will ensure that you won't have extra white space.if all else fails, you can adopt the bandwidth hogging old school method which is take a 1x1 transparent pixel gif and set it to the width you want and make it the first or (my preference was) the last code in the table cell.

Link to comment
Share on other sites

Every cells in a column must always have the same width, or else it wouldn't be a column. So giving a width of X pixels to a cell and a width of Y pixels to another cell in the same column will not work. The only way to work around this is to make your cell span to more than just one column using colspan="2" (for 2 columns, for example).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...