Collapse/Expand elements in a dynamic page if a field in a database is empty

has anyone out there figured out code that works for hiding an element on dynamic pages if the field/table cell is empty? no one seems to have an example of working code. Just code examples that moderators tweek and still don’t seem to work for the person looking for the answer.