Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi There Need some help please

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB

Hi There

Need some help please. <example code @ bottom>

I wanted to fix my table so it always appears 100% of screen width, but dont want to lose data in columns. So I put a div in there to scroll the cell.

However, I loose the vertical align (middle) setting. Anyone think of a way around this?

Thanks
ITflash



<copy & paste the following code and you'll get my dilema>




<table border=&quot;1&quot; style=&quot;table-layout: fixed;&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; bordercolor=&quot;#111111&quot; width=&quot;100%&quot; height=300>

<tr>

<td width=&quot;25%&quot; valign=&quot;middle&quot;>

<div style=&quot;overflow:auto; width=100%; height=100%;&quot;>
start12345678x90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890end

</div></td>
<td width=&quot;25%&quot;>&nbsp;</td>
<td width=&quot;25%&quot;>&nbsp;</td>
<td width=&quot;25%&quot;>&nbsp;</td>
</tr>
</table>

 
If the height will always remain the same:
<div style=&quot;overflow:auto; width=100%; height=300; padding-top: 150&quot;> DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 

Hi There

Thanks for the reply.

I get what you're saying, however, the final HTML will be gerneated from VB Script and the contents of the cell will be of varying lengths (+ heights). I could limit the height, as per example below, but then it is not really valigned in the middle, as the 2nd column.

Copy/Paste example below.

Any other ideas?

Thanks.


<table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot; height=&quot;100&quot; border=&quot;1&quot;>

<tr>
<th width=&quot;80%&quot;>Col 1</th>
<th width=&quot;20%&quot;>Col 2</th>
</tr>

<tr>
<td width=&quot;80%&quot; valign=&quot;&quot;>

<div style=&quot;overflow:auto; width=100%; height=100; padding-top: 30&quot;>

zzzzzzzzzzzz
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
1<BR>
</div>
</td>

<td width=&quot;20%&quot; align=&quot;center&quot;>middle
</td>
</table>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top