I have 3 <p> with set widths, but occassionally i there will be no content inside of them, but I need them to keep their widths, even if no content is inside the <p>.
<div class="grid_12 alpha omega directory-phone-table-row">
<p class="grid_3 phone-name omega"><a href="javascript:;">${firstname}, ${lastname}</a></p>
<p class="grid_3 alpha omega">${phonework}</p>
<p class="grid_3 alpha omega">${departmentName}</p>
</div>
.directory-phone-table .directory-phone-table-data p{
color: #000;
font-size: 12px;
float: left;
width: 220px;
overflow: hidden;
}
I don’t think it’s possible to define a width of a block element when there is no content inside. At least, from my experience anyway. What I normally do is put spaces where you might expect an empty value (better yet, use the html code for space:
). If you have a way to return a space character if data returns nothing — go that route, otherwise you can put a space at the end of your variables like so: