Hide table or component when there is no record in table in pdf generation

Hi Team,

I am generating a pdf. On the pdf template, I have details of the record and its 4-5 child tables. The pdf is generated nicely.
In some scenario, there are possibilities that few tables may not have records. When there are no records in the table there is a row with div with .alert .alert-danger using which, I am able to remove the div which has no record found row. But I am not able to remove table heading because I do not find support for :has().

For example, if in design, the html generated is a follow:

Languages
No Candidate Profile Languages Found
When I try to use: #component_12:has(.alert.alert-danger) { display: none; } it does not work. Also, here we cannot use javascript.

Is there any way, we hide the component_12 when it has div with class=“alert alert-danger”?

How should I handle it?

Thanks,
Khalid

Hi Khalid, there is a javascript feature for pdfs, but it’s a requested feature. You should submit a support ticket (send an email to support@tadabase.io).

P.s. not sure if this feature is supported for every plan level, but theyll be able to tell you at Support.

Hi Kristen,

Thanks for your help.

We got the javascript option for pdf enabled.

Thanks,
Khalid

In the PDF section, go to your PDF Page, and you’ll have a Javascript tab at the top.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.