0

Good Day,

This question is similar to:

jQuery: count number of rows in a table

I am creating an HTML document via XSLT and XML. The main area of the page will contain a table full of alpha numeric data in 3 columns

[Column 1]              [Column 2]      [Column 3]

The issue is that the table can contain as few as 5 rows but as many as 40 rows. I need to put a thin solid border around the div (line-item-info). I know that jQuery can be used to set the height of a DIV after the page has been loaded.

My question is:

Is it possible to set the height of the border at run time? The aforementioned link works with tables, but what about DIV's?

My XSLT template contains the following definition:

<div id="line-item-info">
    <div class="bold itemColumns" style="width: 75px;">&nbsp</div>
    <div class="bold itemColumns" style="width: 325px;">Description</div>
    <div class="bold itemColumns" style="width: 150px;">Qty</div><br />

            <!-- this is each row //-->
    <div class="itemColumns" style="width: 75px;">&nbsp</div>
    <div class="itemColumns" style="width: 325px;">Office Call</div>
    <div class="itemColumns" style="width: 150px;">11.00</div>
</div>

I haven't put in the xsl yet in the row, but this is a sample mockup of what one row would look like.

TIA,

coson

Community
  • 1
  • 1
coson
  • 8,301
  • 15
  • 59
  • 84
  • 1
    Hi, do you want to set `#line-item-info{border-width:2px}` via javascript/jQuery? http://jsfiddle.net/n3kFa/ – Stano Aug 17 '12 at 19:57

1 Answers1

0

you can, with jQuery, set a class, or a specific style to what ever element you want.

see http://api.jquery.com/addClass/ see http://api.jquery.com/css/

ohmusama
  • 4,159
  • 5
  • 24
  • 44