Adjusting Column width of a table

uddi88

New Member
Hi,

I have a table that has only a single row . this row defines the column headers.
the second table has been defined to fetch database values for the respective columns.
Now this 2nd table has been defined inside a <DIV> as follows:
<DIV style="width:100%;height:260;overflow:auto">
this has been done to make the data scrolllable if it exceeds a certain no. of rows.
Now the problem starts : these 2 tables are never properly aligned even though similar width has been defined for every column in both the tables.

Is there ne way to overcome this , i mean any other attribute for <TR> <TD> that can help.

Regards

Uddi
 

jkirchne

New Member
There is no way that I know of that you can do this, perhaps some really strange javascript. May I ask why you are doing it this way?
 

uddi88

New Member
See , if i define a single table inside the <DIV> (as i mentioned ) then , bcoz the first row constitutes the column-headers , it also bcomes scrollable incase the no. of rows exceed a certan limit & i m sure no user wud like to view the data without the headers , right?

Another way of doing this is the use of frames , but considering code maintainability, i was trying to avoid that.

i hope u got that.
 

jkirchne

New Member
is this what you want?
<table width="200px" border="1" title="Table Heading">
<tr><th>Heading</th></tr>
</table>
<div style="width: 220px; height: 100px; overflow: auto">
<table width="200px" border="1" title="Table Body">
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
<tr><td>Item</td></tr>
</table>
</div>
 

jkirchne

New Member
This code is where you are already at. I will see if I can find something that actually does what you want. I do remeber looking for something like this before, but I forget where it was from.
 

uddi88

New Member
Thanks JK

I think this'll work.
Will let u know after i test it out.

Thanks a million!!!

Regards
Uddi
 
Top