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

calculating table height based on table content

Subject: calculating table height based on table content
From: Matt Alexander <matalexa@xxxxxxxxx>
Date: Fri, 28 Sep 2001 15:52:20 -0500
calculate my height
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


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.