As eykanal stated, you cannot accurately predict the user's custom settings. About the only thing you can do is to take a measurement of an element that has two rows of text (place a small amount of text inside a[n off-screen] div element with no padding, and measure the height), and set overflow to hidden.
There are a few tricks you could do to get the ellipsis, but none that I would absolutely recommend. You could absolute position a div inside the parent element (with a relative positioning) and set it to bottom: 0, right: 0, with the same background color as the parent, thus covering up the last bit of text in the element.
<style type="text/css">
#parent {
position:relative;
overflow: hidden;
width: 230px;
height: auto;
background: #f1f1f1;
}
.ellipsis {
position: absolute;
right: 0;
bottom: 0;
background: #f1f1f1;
}
</style>
<div id="parent">
This would be the text that was inserted by the PHP code you mentioned above
<div class="ellipsis">...</div>
</div>
Then for the Javascript to get the height, take this as pseudocode...
<script type="text/javascript">
window.onload = function() {
var textDiv = document.createElement('div');
textDiv.style = 'padding:0;position:absolute;left:-500px;top:-500px;';
textDiv.innerHTML = 'Getting<br>Height';
document.body.appendChild(textDiv);
var textHeight = (textDiv.offsetHeight || textDiv.clientHeight);
document.body.removeChild(textDiv);
document.getElementById('parent').style.height = textHeight;
}
</script>
Of course if you are using a Javascript framework (Mootools, jQuery) you can modify how you create an element, and set attributes, but that should, for the most part achieve something very close to what you are looking for, with minimal tinkering.
You would also want to set the height of all elements with the ellipsis class to half the height retrieved from the javascript.
That's about all I got, man. Hope it helps. :-)