aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Count lines in a div with content coming dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Count lines in a div with content coming dynamically" Watch "Count lines in a div with content coming dynamically" New topic
Author

Count lines in a div with content coming dynamically

prakash rishi
Greenhorn

Joined: Dec 27, 2012
Posts: 2
I have a Div.And in that Content is filled up dynamically,from database. But I want to keep size of Div as much as it is sufficient to show only 2 lines of data.How to achieve this with keeping in mind all those styling and other factors in Mind??
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I have no idea what you are talking about here.

What are you trying to do exactly?Limit it to two lines and hide the rest?
prakash rishi
Greenhorn

Joined: Dec 27, 2012
Posts: 2
The very purpose of me is to limit the content with only 2 lines visible in div, and Hide the rest. It easy to accomplish if we know how much will be font size(let say 10px),and hence we can set div height accordingly. But what if we don't know anything about styling of data. it might have 15 px or 18 px bit I still want to show only 2 lines ,this time div should accommodate itself accordingly. Any Ideas How to do this???
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

I don't understand what your query is but hope this might help


Learning some thing New Every Day
 
jQuery in Action, 2nd edition
 
subject: Count lines in a div with content coming dynamically
 
Similar Threads
retrieve check box value rendered dynamically by a javascript
CSS expanding div
JQuery .on(): Delegating to an enclosing DIV
how to get HTML div id name from RootPanel
is it possible to count the number of lines in the div element?