4 Replies Latest reply: May 31, 2012 4:09 AM by SpryNet RSS

    Hide td in spry data




      I have a table that is populated using a spry datat set.


      I have people's names, date of birth, nationality...and date deceased.


      On the date deceased, if the person is dead i want to display the date as inputed in the xml. If it is empty, that means the person is still alive, so instead of having a blandk area or 'td' if the person is alive, i want it to be written 'alive'.


      Ive tried this and other solutions but so far nothing has worked:


      <td class="button" style="padding: 8px;"><span spry:if="{ds_UnfilteredRowCount} != 0">{died}</span>Alive!</td>



        • 1. Re: Hide td in spry data
          Ben Pleysier MVP

          please supply a link to your site



          • 2. Re: Hide td in spry data
            SpryNet Community Member

            Sorry the site is not online yet, but here is the relative code:


            <div spry:region="dsname" class="stable">

            <table width="100%" cellpadding="10" cellspacing="0">

                             <tr align="left">

                               <th  class="head" spry:sort="title">Title</th>

                               <th class="head" spry:sort="first_name">Name</th>

                               <th class="head" spry:sort="family_name">Family Name</th>

                               <th width="60" class="head" spry:sort="died">Died</th>


                             <tr spry:repeat="dsname" spry:setrow="dsname" spry:odd="odd" spry:even="even" spry:hover="hover" onclick="document.location = 'ds.cfm?name_id={name_id}';">

                               <td width="135"   class="tstyle">{title}</td>

                               <td> <span>{first_name}</span></td>

                               <td> {family_name}</td>


                               <td><span spry:if="{ds_UnfilteredRowCount} != 0">{died}</span></td>





            In the td where it displays the date deceased, if it is empty i would like it to display "Alive!"


            Hope that helps.

            • 3. Re: Hide td in spry data
              Ben Pleysier MVP

              Try similar to

              <td spry:if="'{died}' == '0'">Alive</td>

              <td spry:if="'{died}' != '0'">{died}</td>


              • 4. Re: Hide td in spry data
                SpryNet Community Member

                Thanks alot gramps,


                That exact code didn't work, i changed the '!=' to '<' and its now working great:


                <td spry:if="'{died}' != '0'">{died}</td>

                <td spry:if="'{died}' < '0'" >Alive!</td>



                Again, your help was much appreciated.