one column width in pixels, want to define other rows in %

2 replies
  • WEB DESIGN
  • |
've heard that pages load faster when all widths are defined, and as I'm looking to make a business site I want everything to be correctly coded. I have a table that is 82% of the screen width. The left column has a width measured in pixels to nicely surround an image. The other 4 columns have text only so I'm not as fussy about their widths, but ideally they need to be defined. I do not want to define them in pixels also as I like scalable sites and if one were to have a large screen resolution, a table with all widths defined in pixels would be too small on the screen.

I've thought about having two different tables side by side, or building the whole thing out of divs, but the problem I'm having there is that I can't make all the borders/rules look the same as with the example below, where all lines are a consistant thickness instead of the doubling of lines that occurs when you place two divs together. Anyone have any ideas about this?

edit: maybe it's much simpler to have all column widths as percent and have the left column images scale to (almost) fit the cells that they are in. How can I code that so that the images do this and still have an even space around all sides between the image and the borders of the cell?
#column #define #page not found #pixels #rows #width
  • Profile picture of the author Richard Whyte
    Hi

    First off, I DON'T like scalable sites. You have no control over how your site is going to look on the viewers screen and it can end up being horrible..... Really!

    But if you really, and I mean really, really.... Want to do it that way.... You can setup your table to use a fix number for the column with the image size and the rest of the columns can be %.

    You can nest tables inside of tables to get the look and feel you want. Like a two column table. One has the image and the other one has another table inside of it. The nest table has the four columns you want and each is setup as a percentage in size.

    That is just a single way to this and I can think of others right away. Just depends on your design style.....

    I don't use tables anymore for page layout. Everything is done in CSS and if you are looking for longevity, you want to really be thinking about CSS.

    Tables are old hat... Yes, they can still be used for layouts... But things are changing rapidly, new devices are being used for display and you want to write your pages to current standards based code....

    Hope that helps you out.

    Have a Great Day!
    {{ DiscussionBoard.errors[2019742].message }}
  • Profile picture of the author Aronya
    I'll second what Richard said. Also, as far as I know, there's no way to make images scale to fit their cells. It normally only works the other way around, although there may be a way to do it dynamically with PHP.
    {{ DiscussionBoard.errors[2019990].message }}

Trending Topics