View generated columns

As you probably know, when you use expandable views on the Web, the columns are set to the width dynamically by the content of the column, which means that all headers of the columns are show as one string. (ugly!) By using HTML columns generated by the view, we can eliminate this and set our own start width. You can even set the maximum width when you expand this method with the following:


Use a HIDDEN first column when you want to sort the content in a NONE categorized view, or use a First categorized column which is not hidden and don't show this field with the function.

Replace the fieldnames in the values string in the example with your fieldnames and define in the Width string the width of the columns you want to use.

1);"";"/")+"/"; Div:="##!!##"; Value:=FIELD1+Div+FIELD2+div+FIELD3+div+FIELD4+div+FIELD5+div+FIELD6+div+FIELD7; Width:="50"+div+"30"+div+"120"+div+"60"+div+"60"+div+"60"+div+"60"; COLUMN1:="[<TD NOWRAP WIDTH="+@Word(Width;div;1)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;1)+"</A></FONT></TD>]"; COLUMN2:="[<TD NOWRAP WIDTH="+@Word(Width;div;2)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;2)+"</A></FONT></TD>]"; COLUMN3:="[<TD NOWRAP WIDTH="+@Word(Width;div;3)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;3)+"</A></FONT></TD>]"; COLUMN4:="[<TD NOWRAP WIDTH="+@Word(Width;div;4)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;4)+"</A></FONT></TD>]"; COLUMN5:="[<TD NOWRAP WIDTH="+@Word(Width;div;5)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;5)+"</A></FONT></TD>]"; COLUMN6:="[<TD NOWRAP WIDTH="+@Word(Width;div;6)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;6)+"</A></FONT></TD>]"; COLUMN7:="[<TD NOWRAP WIDTH="+@Word(Width;div;7)+"><FONT SIZE=2 FACE="Verdana"><A
HREF=""+DB+"0/"+@Text(@DocumentUniqueID)+"?OpenDocument"+"">"+@Word(Value;div;7)+"</A></FONT></TD>]"; Column1+Column2+Column3+Column4+Column5+Column6+Column7

This was first published in May 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.