Subject: RE: [xsl] calculating table height based on table content From: "Chris Bayes" <chris@xxxxxxxxxxx> Date: Fri, 28 Sep 2001 22:28:28 +0100 |
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: [xsl] 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] calculating table height base, Matt Alexander | Thread | [xsl] Only copy nodes that have tex, mjyoungblut |
RE: [xsl] Only copy nodes that have, Chris Bayes | Date | RE: [xsl] Newbie question - transfo, Chris Bayes |
Month |