jDownloadsownloads.com

Author Topic: th tags not render properly in layout  (Read 831 times)

0 Members and 1 Guest are viewing this topic.

Offline TLWebdesign

  • Newbie
  • *
  • Posts: 23
    • TLWebdesign
th tags not render properly in layout
« on: 07.08.2020 17:48:58 »
I added custom layout with a table and vertical th like for example this:

<table class="table table-condensed table-striped">
            <tbody>
<tr>
               <td>{filesize_title}</td>
               <td>{filesize_text}</td>
            </tr>

generates this:

<table class="table table-condensed table-striped">
            <tbody><tr>
               <th></th>
               
            </tr>
            <tr>
               <td>Grootte</td>
               <td>6.26 MB</td>
            </tr>

it adds rows at both ends of the table with an empty th.
« Last Edit: 15.08.2020 00:38:27 by ColinM »

Offline ColinM

  • Moderator
  • *
  • Posts: 3.975
Re: th tags not render properly in layout
« Reply #1 on: 09.08.2020 11:20:44 »
Hi
Could you please export your layout and send it to me so I can look in more detailWhich version of jD are you using? 

Colin

Offline TLWebdesign

  • Newbie
  • *
  • Posts: 23
    • TLWebdesign
Re: th tags not render properly in layout
« Reply #2 on: 10.08.2020 12:07:50 »
Here it is.

I changed the extension to .txt so i could upload it here. I'm on JD 3.9.0.6

Offline ColinM

  • Moderator
  • *
  • Posts: 3.975
Re: th tags not render properly in layout
« Reply #3 on: 10.08.2020 16:50:10 »
Hi
The 'challenge' was that the jD front end css hads a rule
.jd-item-page tr, .jd-item-page td {
    border: 0px !important;
}- the <th> was ok
So I modified your layout with added style for the <td> elements   See pic for result and copy of the modified layout
You could put the relevant CSS in jD custom.css to make it better  - you would also need a last child to do the line at the bottom
Colin

Offline TLWebdesign

  • Newbie
  • *
  • Posts: 23
    • TLWebdesign
Re: th tags not render properly in layout (sorted)
« Reply #4 on: 14.08.2020 10:05:40 »
Hmm no this was not the issue.  I figured what the issue is. And it is a problem of my own. Something i didn't take into consideration. the empty rows are the {license_title} row and {system_title} these appear to be empty and so they end up as empty rows with the second td stripped. 

Uhm how can i make those rows "responsive"? so they're not generated when there is no value? Kind of like RSForms handles this: {if {license_title}}<tr><td>{license_title}</td></tr>{/if}.

i couldn't find something similar in your documentation. or something that also has the same effect.

Kind regards,

Tom

Offline ColinM

  • Moderator
  • *
  • Posts: 3.975
Re: th tags not render properly in layout
« Reply #5 on: 15.08.2020 00:44:47 »
Tom
With jd3.9.1 in FrontEnd Options there are two settings, 'Remove label if field empty' and 'Remove empty HTML tags' that resolve the situation in the standard 'div' based layouts. but they are unlikely to work with table based items.
I will do some experiments this weekend
Colin