Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ for more details.
I've been doing a fair amount of ADF work recently and especially dealing with tables. What I found was that when a table contained no data, the emptyText string rendering is very ugly by default, so I got exploring. It turns out you can put HTML into this string and customise how it is rendered with some CSS.

Here is what I mean by ugly, there really should be some padding on the left of the text.

My end result was to add a small amount of padding to align the emptyText to the table header. It looked like this:

Much more pleasant to look at!

To get this to work, I had to put HTML into the emptyText attribute of af:table. Here's a code snippet:
 af:table snippet
emptyText="&lt;html>&lt;span style=&quot;padding-left:2px;&quot;>No Data&lt;span>&lt;/html>"

The CSS adds a 2-pixel padding on the left of the text, it's as simple as that.

Note that the start of the tags have to be escaped, this had me stuck for a while. Also note that the entire string has to be encompassed inside a <html> element.


Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...