The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HTML Nested tables, Nested Tables overlapping
yls
post Feb 27 2010, 03:03 PM
Post #1


Newbie
*

Group: Members
Posts: 15
Joined: 13-February 10
Member No.: 11,084



Hi, I'm new to HTML. I have not yet started using CSS. I'm just using basic html. I'm having problem creating a nested table as shown in the attachment without using CSS style sheets. I appreciate anyone's suggestions in this. I pasted the code that tried below.


<h3> 5) - Nested Table </h3>

<table align="left" width="350" bgcolor="#ffff00" border="1">

<tr height="75" align="left">
<td height="100" > </td>
<td height="75"> test2 </td>
<td height="75"> </td>
</tr> <clear="left" />

<tr>
<td>
<table align="left" bgcolor="f5f5dc" border="1">
<tr>
<td width="100%" height="75"> a nested table </td>
<td width="100%" height="75"> With this text at the top </td>
</tr>
<tr>
<td width="100%" height="75"> </td>
<td width="100%" height="75"> </td>
</tr>
</table>
</td>
</tr>

<tr height="75" align="left">
<td></td>
<td></td>
<td></td>
</tr>

</table>



Thanks in advance
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 27 2010, 03:52 PM
Post #2


Computer says no.
********

Group: WDG Moderators
Posts: 18,968
Joined: 9-August 06
Member No.: 6



The only things obviously wring I notice are these.

1. There isn't an element called CLEAR. In addition to that, you can't put anything between </tr> and <tr>. The elements that make up a table are special, a kind of wrapper elements. You can put content, text or other elements, only in TD or TH, nothing goes between the table elements.

HTML
<table>
<!-- Nothing goes here -->
<tr>
<!-- Nothing goes here -->
<td>Everything here</td>
<!-- Nothing goes here -->
</tr>
<!-- Nothing goes here -->
<tr>
<!-- Nothing goes here -->
<td>... and here</td>
<!-- Nothing goes here -->
</tr>
<!-- Nothing goes here -->
</table>


2. TR can't have a height.

3. The width and height of the cells don't add up. All the cells in a row much have the same height (it's enough to set the height for one of them). Likewise the cells in a column must have the same width. Furthermore, when you use percent, it must add up to 100%. In the nested table, both cells in the a row can't be 100% wide. That would make them twice as wide as the whole table.


OK, in what way don't the tables work for you? How do you want them to look?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
yls
post Feb 27 2010, 03:57 PM
Post #3


Newbie
*

Group: Members
Posts: 15
Joined: 13-February 10
Member No.: 11,084



Thanks for the response but I'm still that clear what you were talking. I have added an attachment to get an idea how it has to be shown.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 27 2010, 06:44 PM
Post #4


Computer says no.
********

Group: WDG Moderators
Posts: 18,968
Joined: 9-August 06
Member No.: 6



No attachment.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
yls
post Feb 27 2010, 11:36 PM
Post #5


Newbie
*

Group: Members
Posts: 15
Joined: 13-February 10
Member No.: 11,084



Oops! sorry. I'm not able send this that clearly as this forum doesn't accept pictures. A table that has 3rows and 3columns but the 2nd row again should have a inner table with 2rows and 2columns. Just tried show that in word to give you some idea.

Thanks for your helpAttached File  nested.doc ( 25.5k ) Number of downloads: 448
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Feb 28 2010, 12:47 AM
Post #6


WDG Member
********

Group: Root Admin
Posts: 8,335
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



It looks like you need to use colspan on the td for the row containing the nested table.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 28 2010, 12:58 AM
Post #7


Computer says no.
********

Group: WDG Moderators
Posts: 18,968
Joined: 9-August 06
Member No.: 6



Yes and to accomplish different margins on top and bottom of the nested table you'd have to use CSS (or end up with a mares nest of empty cells).

The forum does accept images, but maybe not every format out there. GIF, JPG and PNG should be fine, IIRC.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 6th August 2020 - 11:53 PM