Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - hot to align inner table cols with outer table cols

 
Thread Tools Search this Thread
Old 05-23-2006, 09:59 AM   #1
Default hot to align inner table cols with outer table cols


hi,

I have data which I display in a table with 5 columns, some of this
data needs to be collapsable, so user can hide it if they wish. I am
trying to do this with a main table of 5 columns for none collapsable
data and inner tables of the same demensions for collapasable items,
with is displayed or hiddened depending what user selects, using
jscript. The html would look like this:

<table border="1" id="table1">
<tr>
<td style="width: 400px">hello</td>
<td>world</td>
</tr>
<tr>
<td colspan="2">
<table border="1" id="table2">
<tr align="left">
<td style="width: 400px">hello new</td>
<td>world</td>
</tr>
</table>
</td>
</tr>
</table>

The problem is with this layout the inner table is shifted a little to
the right, hence the columns of the inner and outer table aren't
matching properly.

Can anyone help or provide alternative method?

Thanks
-phl



phl
  Reply With Quote
Old 05-23-2006, 10:43 AM   #2
Sid Ismail
 
Posts: n/a
Default Re: hot to align inner table cols with outer table cols

On 23 May 2006 01:59:46 -0700, "phl" <>
wrote:

: hi,
:
: I have data which I display in a table with 5 columns, some of this
: data needs to be collapsable, so user can hide it if they wish. I am
: trying to do this with a main table of 5 columns for none collapsable
: data and inner tables of the same demensions for collapasable items,
: with is displayed or hiddened depending what user selects, using
: jscript. The html would look like this:
:
: <table border="1" id="table1">
: <tr>
: <td style="width: 400px">hello</td>
: <td>world</td>
: </tr>
: <tr>
: <td colspan="2">
: <table border="1" id="table2">
: <tr align="left">
: <td style="width: 400px">hello new</td>
: <td>world</td>
: </tr>
: </table>
: </td>
: </tr>
: </table>
:
: The problem is with this layout the inner table is shifted a little to
: the right, hence the columns of the inner and outer table aren't
: matching properly.
:
: Can anyone help or provide alternative method?


It's the default cellspacing and cellpadding. Set them to zero in the
inner table.

Sid


  Reply With Quote
Old 05-23-2006, 11:58 AM   #3
phl
 
Posts: n/a
Default Re: hot to align inner table cols with outer table cols

thanks that helped alot.

why is it that if I set the a width to say "700px" in the outer table,
the cols in the inner table becomes unaligned with the outer? Is there
anyneed to set table width once I have all tables width set?

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump