Align data across columns when using CFIF

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Align data across columns when using CFIF

    Hello,

    I am unable to align data in a row, across columns when I use CFIF in one of
    the columns.

    All of the data must align across the rows. When the CFIF is used, sometimes
    data will appear and sometimes it won't. But, this then creates a problem with
    the alignment of the data in the next column.

    Any help is appreciated as I have now spent a whole day looking at this.

    John

    <cfoutput query="NeedtoTake" group="RESPONSIBILITY_NAME">
    <tr align="left" valign="top">
    <td height="28"><font size="2" face="Arial, Helvetica,
    sans-serif">#RESPONSIBILITY_NAME#</font></td>
    <td><cfoutput><font size="2" face="Arial, Helvetica, sans-serif">
    <a
    href="http://www.web.virginia.edu/DOTWeb/inventorybyempl2sched.cfm?AbstractName=
    #REQUIRED_COURSE_ALT_1_ID#">#CURRENT_VALID_REQUIRE D_COURSE#</a>

    <cfif #COURSE_VALIDITY_EXPIR_DATE# NEQ''><font size="2" face="Arial,
    Helvetica, sans-serif">*Course taken on
    #DateFormat(COURSE_START_DATE,"mm/dd/yyyy")# but it expired on
    #DateFormat(COURSE_VALIDITY_EXPIR_DATE,"mm/dd/yyyy")#. This course must be
    retaken.<cfelse></cfif>
    <p></cfoutput>&nbsp;
    </td>
    <td><cfoutput><cfif COURSE_START_DATE GTE #DateFormat(Now(),'mm/dd/yyyy')#>
    <cfif COURSE_VALIDITY_EXPIR_DATE NEQ''><font size="2" face="Arial, Helvetica,
    sans-serif">#DateFormat(COURSE_START_DATE,"mm/dd/yyyy")# <cfelse><font size="2"
    face="Arial, Helvetica,
    sans-serif">#DateFormat(COURSE_START_DATE,"mm/dd/yyyy")#</cfif></cfif><br>&nbsp;
    <br>&nbsp;<p></cfoutput>
    </td>
    </tr>
    </cfoutput>

    JohnCHill Guest

  2. Similar Questions and Discussions

    1. DataGrid columns from data
      I posted this under the FlexBuilder topic then realized it is more appropriate here. I noticed in the database sample program, the results of the...
    2. align data column from codebehind
      Hello. I've started a datagrid in codebehind and need to have the numeric columns right aligned. here's the code: ----- Select Case arThis1(1)...
    3. how to Align text left & vertical align middle
      Hello, I have a asp lable control, which I use to display text in, I would like to have the text display aligned in the center and vertical...
    4. can't get data to show with bound columns
      I'm trying to create a DataGrid filled with values from a DataSet and I want the user to be able to show and hide whichever columns they choose. I...
    5. Pad strings/concatenate columns to simulate data columns in ASP select box with SQL Server 2K
      Dale, Cast all the data to fixed character data type in your select statement. For example: select cast(au_id as char(12)) +...
  3. #2

    Default Re: Align data across columns when using CFIF

    Although I havn't looked at your code thoughily you may want to concider the
    isdefined() function. That way you can see if a value does exsist, and if it
    does, create the table column or whatever, and if it doesn't then just move on
    the next one. Sorry if im way off base here, just a quick idea. Good luck.

    kenji776 Guest

  4. #3

    Default Re: Align data across columns when using CFIF

    I'm a bit confused at why it is creating a problem with the alignment ??

    I understand that if the first "RESPONSIBILITY_NAME" has 3 records associated
    with it and the next only has 2 that there will be a column missing from the
    end.

    So, can you give a visual demo of what your require and what the code is
    producing ?

    In the mean time I've got some suggestions for you code, I assume the date
    columns are date/time data types ?

    Then

    <cfif #COURSE_VALIDITY_EXPIR_DATE# NEQ''>
    would be better as
    <cfif IsDate(COURSE_VALIDITY_EXPIR_DATE)>

    <cfif COURSE_START_DATE GTE #DateFormat(Now(),'mm/dd/yyyy')#>
    would be better as
    <cfif DateCompare(COURSE_START_DATE, Now()) Is 1>

    <cfif COURSE_VALIDITY_EXPIR_DATE NEQ''>
    would be better as
    <cfif IsDate(COURSE_VALIDITY_EXPIR_DATE)>

    Also in this cfif you are outputting the ssame value in both the if and the
    else

    Ken

    The ScareCrow Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139