Cfselect option value in table display format

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ismailc
    New Member
    • Sep 2006
    • 200

    Cfselect option value in table display format

    Hi,

    I would like to display my values in a table format, view code at the bottom.
    i get data but in no order it's all very untidy i cant do a <td width="13">
    for each option - it display very untidy & unreadable

    Code:
      <select name="S_Selectfrombox" size="10" query="Q_CodeDescr"cols="40">
               <cfloop query="Q_CodeDescr">
    		<CFSET V_Optionvalue1 = #Descr2#> 
    		    <CFSET V_Optionvalue2 = #Descr3#> 
    		    <CFSET V_Optionvalue3 = #Descr4#>
    	        <optionvalue="#V_Optionvalue1#" "#V_Optionvalue2#" "#V_Optionvalue3#">
    #V_Optionvalue1# #V_Optionvalue2# #V_Optionvalue3#
    any ideas, please help
    Last edited by acoder; Apr 2 '12, 01:36 PM.
  • rameshsambu
    New Member
    • Oct 2006
    • 15

    #2
    Hi ismail,

    firstly may i ask why would you like to display table like data inside
    a select box?

    consider using three select boxes side by side

    or else you can remove the select box and put table in that place.

    what i say may not be what you require. anyways if you clarify your need
    i can surely help


    Ramesh

    Comment

    • ismailc
      New Member
      • Sep 2006
      • 200

      #3
      Hi, Thank You replying

      The problem i have is that I have 10 000 records to be displayed on screen and on change i update an textarea, the problem is that i will have so many next link pages and want to keep it in the same page where i the user can scroll down and select with the textarea box displayed at the bottom. [IMG]c:\coulmns.jpeg[/IMG]

      i played with frames but then have a problem with passing all the variables.

      Please is there a way making the data look nice = columns
      this is how my select box look at the moment
      1234 Test test2 test3 12345 12345
      123 test tes4 test6 test7 no no no no
      12347 test no no no

      it's very untidy & difficult to read.

      Please !!!

      Thank You

      Comment

      • rameshsambu
        New Member
        • Oct 2006
        • 15

        #4
        hi Ismail

        sorry for responding late, was sleeping extensively.

        It seems you need to insert extra spaces so that all 3 data in select list gets aligned.

        if you are using mysql try modifying the select statement to this

        Code:
        <cfquery name="Q_CodeDescr" ...>
        select ....  RPAD(V_Optionvalue1,15,' ') as V_Optionvalue1, RPAD(V_Optionvalue2,15,' ') as V_Optionvalue2, RPAD(V_Optionvalue3,15,' ') as V_Optionvalue3 .... from  ....
        ....
        </cfquery>
        basically this is right-padding the 3 required fields with spaces so that a fixed length column is returned. change the 15 to the required number as per your need.


        try this and please let me know if it works.


        -Ramesh

        Comment

        Working...