Collapsing table cells?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Collapsing table cells?

Post by alex.barylski »

Tricky table problem.

I have the following:

Code: Select all

<table width="100%">
  <tr>
    <td>A</td>
    <td>B</td>
  </tr>
  <tr>
    <td colspan="2">C</td>
  </tr>
</table>
By applying the colspan in cell C the two cells above it are width calculated in half. Each is 50% the width of the of cell C

I cannot use width="100%" in cell A but that is the effect I am after. Actually to be exact I want cell B to automatically adjust to it's contents size, as I am already using width="100%".

Is this desired collasping effect possible?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If "C" is the last row you could generally use a div for it.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

What are you trying to achieve here hockey?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Everah wrote:What are you trying to achieve here hockey?
It's hard to explain using just that example...no worries though I figured out another solution. :)
Post Reply