[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: calculating table height based on table content

Subject: RE: calculating table height based on table content
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Fri, 28 Sep 2001 22:28:28 +0100
calculate div height
Matt,
Maybe I didn't read that right.
Why don't you just do
<div style="overflow:scroll;height:Y0px;width:X0px;">
<xsl:apply-templates....
</div>
You can set the Xpx and Ypx in an onload function which basicaly
calculates screenHeight - (headerHeight + footerHeight). Then it doesn't
matter what size the screen is. Otherwise you have no chance it is a
*mare*

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Matt Alexander
> Sent: 28 September 2001 21:52
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  calculating table height based on table content
> 
> 
> 
> hi,
> 
> i am creating a dhtml table which has a scrollable content 
> section. i need to set the height of the tables content in 
> pixels (the column headers and footer are static height) so 
> that the scrolling function knows how much it needs to scroll 
> up and down these rows.
> 
> i currently calculate the height of this area by... 
> <xsl:variable name="content_height"><xsl:value-of
> select="count(//row)*25"/></xsl:variable>
> which is fine when all of the data fits nicely into the 
> column. however, if the data is wider than the set width, it 
> wraps onto the next line, etc... so i need a way to determine 
> how many "lines" each row is taking up. the number of columns 
> and rows are variable. the width for the columns + row_data 
> is set inside the column elements.
> 
> for each row i need to check all of the row_data's for the 
> length of their content and divide it by the width set in its 
> correlating column element adjustinf with some approximate 
> for pixels/letter, giving me the approximate # of lines this 
> row takes. then for each row i just count the greatest, to 
> determine how many lines this row takes up, then sum all of 
> these together and multiply by 25 as my set row height.
> 
> i don't know that i explained this well,
> it seems like quite a mess to me,
> but here is a generic example of my data...
> thanks,
> matt
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <tab>
> 	<columns>
> 		<column width="25">...</column>
> 		<column width="100">...</column>
> 		<column width="50">...</column>
> 		<column width="77">...</column>
> 	</columns>
> 	<rows>
> 		<row> 
> 			<row_data>...</row_data>
> 			<row_data>...</row_data>
> 			<row_data>...</row_data>
> 			<row_data>...</row_data>
> 		</row>
> 		<row>
> 			<row_data>...</row_data>
> 			<row_data>...</row_data>
> 			<row_data>...</row_data>
> 			<row_data>...</row_data>
> 		</row>
> 	</rows>
> </tab>
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.