table formatting in html

Sharky Forums


Results 1 to 4 of 4

Thread: table formatting in html

  1. #1
    Hammerhead Shark
    Join Date
    Feb 2001
    Posts
    1,612

    table formatting in html

    here's what i'm trying to accomplish:

    Code:
    ---------------------------------
    |                        |      |
    |                        |      |
    +-----+------------------+------+
    |     |                         |
    |     |                         |
    +-----+------------------+------+
    |                        |      |
    |                        |      |
    ---------------------------------
    that is, a three-column table, but one of the cells (either on the right or left, alternating) takes up two of them. The middle cell should be the largest. The small cell should only contain a small picture.

    here's what I'm doing right now:
    Code:
    <TABLE BORDER=0 CELLSPACING=10>
    <COL WIDTH="10%">
    <COL WIDTH="80%">
    <COL WIDTH="10%">
    <TR>
    	<TD COLSPAN=2>blah blah blah...
    	<TD><img ...>
    but having the percents seems like a bad way to do it, because it might not work as well on different resolutions. Is there any way to get it to just reserve enough space for columns 1+3 to hold the pictures? I bet I could specify them directly:
    Code:
    <TABLE BORDER=0 CELLSPACING=10>
    <COL WIDTH=100>
    <COL>
    <COL WIDTH=100>
    <TR>
    	<TD COLSPAN=2>blah blah blah...
    	<TD><img ...>
    but then if I use different sized pictures, i have to manually change the column widths.

    EDIT: NEVERMIND THAT DOESN'T WORK.. I HATE THIS !!
    It seems to want to reserve all the space it can for column 3, even though it would work perfectly to only make it 100 pixels wide.

    EDIT AGAIN: THIS IS RETARDED
    Code:
    <TABLE BORDER=0 CELLSPACING=10>
    <COL WIDTH=116>
    <COL WIDTH=400>
    <COL WIDTH=116>
    <TR>
    	<TD COLSPAN=2>blah blah blah...
    	<TD><img ...>
    you'd think that would make column 1 116 pixels wide, column 2 400 pixels wide, and column 3 116 pixels wide.. but it DOESN'T!! not in IE anyway! (netscape works fine...) In IE, I get a 116-pixel column, then probably a 0-width column, and finally another column that's, maybe, 516 pixels wide! what is going on???
    Last edited by Strogian; 02-11-2004 at 10:56 AM.

  2. #2
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077
    Like anything there's more than one way to skin a cat. Here are two possible approaches that first come to mind.

    Hopefully you can use these as guidelines and get what you're shooting for. Best of luck.

  3. #3
    Reef Shark
    Join Date
    May 2001
    Location
    Florida
    Posts
    421
    Grizzly's ways are probably the better way to go, but I used to accomplish what you describe by setting a fixed width to those cells that I wanted fixed and then set the 'expandable' one to "width=*" which just filled in the rest of the page to 100%.
    | Processor | Intel Pentium 4 @ 2800 MHz | Motherboard | ABIT IC7-Max3 | Memory | 2 GB Corsair XMS PC3200 DDR | Graphics | ATI Radeon 9800 Pro | OS/Prog HDD | W.D. Raptor 36GB (10k) SATA | Storage HDD | Seagate 160GB (7200) SATA | Burner | Lite-On 52x24x52 CDRW | DVD-ROM | Lite-On 16x DVD | Sound Card | Philips Acoustic Edge | Speakers | Klipsch ProMedia 2.1 | Flash Media | Lian-Li Flash Media Bay | Display | Dual NEC 22" Flat CRT | Case/PSU | Lian-Li PC-65B w/ Antec 430W | O.S. | MS Windows XP Pro | Printer | Epson Stylus Photo 2200

  4. #4
    Hammerhead Shark
    Join Date
    Feb 2001
    Posts
    1,612
    Oh yeah, now I see what's going on. In my examples, I didn't actually have anything in the second column by itself. I still think that it *should* apply the formatting I specify with the <COL> tags, but what are you going to do...

    thanks for the help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •