Forum Moderators: open

Message Too Old, No Replies

Is this possible with a single table?

cell gymnastics

         

Tonearm

1:36 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible to get a table like this:

<table border="1">
<tr>
<td colspan="2">o</td>
<td rowspan="2">0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
</tr>
</table>

to split the (visually) far right cell into two cells (top and bottom) and have the dividing line between those new cells be about half-way up the table (not where the other horizontal line makes it easy).

I'm sorry if this is too cryptic. Please let me know if this description it no good.

- Grant

P.S. Without using CSS.

isitreal

2:05 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



no, it's too cryptic, try describing the structure you want explicitly, or sticky a link to sample

Tonearm

4:51 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Imagine a square grid of 9 equal parts, three on each side. Here are the grid boxes numbered:

123
456
789

Boxes 1 & 2 would be one cell, boxes 4 & 7 would be one cell, and boxes 5 & 8 would be one cell. The area making up boxes 3, 6, & 9 would be split horizontally across the middle to create two cells, one on the top and one on the bottom of the split.

Does that do it?

TheDoctor

10:02 am on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have a grid 3x3, then you have, by definition, nine cells arrranged in three rows and three columns. beacuse of this, your question doesn't (to me at least ;)) make sense.

Perhaps if you start by saying what you want to achieve, rather than how you want to achieve it, your question might be clearer.

tedster

12:17 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think I get it -- you'd need to nest a new table in cells 3,6,9 to get that effect.

TheDoctor

1:14 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think I get it now, but you need a multiplicity of nested tables. You can't do it in one table.

You need a table of one row and two columns:


1 In the cell at column one: place a table containing two rows and one column:
1.1 In the cell at row one: place 1&2
1.2 In the cell at row two: place a table with one row and two columns:
1.2.1 In column one: place 4&7 (you might have to nest another table to get the effect you want)
1.2.2 In column two 5&8 (again, this might need another nested table)
2 In the cell at row two: place a table containing two rows; place 3,6 & 9 in the cells of this table.

pageoneresults

1:26 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<table width="100%">
<tbody>
<tr>
<td width="66%" colspan="2"></td>
<td width="34%"></td>
</tr>
<tr>
<td width="33%"></td>
<td width="33%"></td>
<td width="34%"></td>
</tr>
</tbody>
</table>

Because I use FP, this was fairly simple to figure out. Problem is, when you get to merging 3, 6 and 9 you lose the third row.

TheDoctor's solution of nesting tables is probably the only way to do this. I hate nesting things. ;)

Leosghost

1:39 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



worse is unesting them from someone elses pages when it wasn't needed in the first place....I've got one with some tags that still shouldn't be there... I just gave up....

Pagemill was the worst for generating nested tables in wysiwig that I ever saw ....

TheDoctor

2:29 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I hate nesting tables as well. But the spec was to produce the layout using tables only.

Tonearm

3:07 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks a lot for your help guys. Too bad one table is a no-go. Two tables will do it though. Thanks again!

TheDoctor

3:27 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How do you manage it with only two tables? I calculate four is the minimum, but I'm always prepared to learn.

Others may like to know as well.

Tonearm

5:17 pm on Apr 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is what I was after with one table:

<table border="1">
<tr>
<td colspan="2">-</td>
<td rowspan="2">
<table border="1">
<tr>
<td>0</td>
</tr>
<tr>
<td>0</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
</tr>
</table>

brdwlsh

7:39 pm on Apr 12, 2004 (gmt 0)

10+ Year Member



i think this is what final product was supposed to look like, i used three tables.

<table width="25%" height="25%" cellpadding="0" cellspacing="0">
<tr><td>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="1">
<tr>
<td width="100%" height="34%" colspan="2">1,2</td>
</tr>
<tr>
<td width="50%" height="66%">4<br/>7</td>
<td width="50%" height="66%">5<br/>8</td>
</tr>
</table>
</td>
<td>
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="1">
<tr>
<td width="100%" height="50%">3<br/>6</td>
</tr>
<tr>
<td width="100%" height="50%">6<br/>9</td>
</tr>
</table>
</td></tr>
</table>

Leosghost

9:27 am on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Guess what were all gonna be doing this coffee break?

Compulsive propeller heads the lot of us...=)

TheDoctor

9:29 am on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tonearm, your solution doesn't produce what you requested. To get what you asked for in msg #3 you need a couple more nested tables.

But I'm glad you got what you wanted :)

Tonearm

6:04 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The Doctor -

Huh? Have you tried putting it in a browser? I'm guessing you have, but just confirm for me if you would.

john_k

6:30 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's a one table solution:

<table border="2" cellspacing="2" cellpadding="2">
<tr>
<td colspan="2">1 and 2</td>
<td rowspan="2">3 and part of 6</td>
</tr>
<tr>
<td rowspan="2">4 and 7</td>
<td rowspan="2">5 and 8</td>
</tr>
<tr>
<td>part of 6 and 9</td>
</tr>
</table>

The actual contents will dictate the heights.

TheDoctor

11:42 pm on Apr 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Tonearm, re-reading your description of what it is you wanted, I think I may have misinterpreted it as you wanting something slightly more complex than you did.

Sorry for the confusion.

Purple Martin

12:24 am on Apr 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



john_k has the simplest solution.

Some editors are good at making these complex tables for you, here is just one example:
In HomeSite, open the Quick Bar, click on the Tables tab, and click on the Table wizard button. The first page of the wizard can do everything you want to add rows and columns and span them any way, just play with the + and - buttons.

Not that I'd ever use a complex table ;)

Tonearm

1:45 am on Apr 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



john_k -

I haven't tested your code yet (wish I could copy/paste from browser to vi), but that's awesome if you pulled that whole thing off in one table. I thought there was no way. Nice!

Tonearm

1:46 am on Apr 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Purple Martin -

While we're on the suubject, isn't it better to use non-nested and overall fewer tables?

vkaryl

2:36 am on Apr 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



(wish I could copy/paste from browser to vi)

What's wrong with using notepad as an intermediary?

Purple Martin

5:06 am on Apr 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



While we're on the suubject, isn't it better to use non-nested and overall fewer tables?

Probably, however I'd much rather use CSS-positioned divs. That is an entirely separate (and huge) debate that has been covered a lot. Rather than restart it all over again it here, I'll point you to these recent topics which contain many interesting opinions:
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]
In fact I'm sorry I even raised it here. Me and my big mouth. I'll shut up now!