Stefan Motz
asked on
How to display only the fist 50 characters of a record, then click to expand the table
Hi Experts,
On my web page I'm displaying database records. One column is named "Comments" and it is varchar(MAX) data type in the SQL Server database.
<td align="left"><%=rs("Commen ts")%></td >
The table cell becomes too big when the Comments field contains too many characters. Is it possible to display only the first 50 characters of each record, then when the TD is clicked, it expands and shows the full record? When a different record is clicked it collapses to show the first 50 characters only.
My page is written is Classic ASP.
Thank you for your help.
On my web page I'm displaying database records. One column is named "Comments" and it is varchar(MAX) data type in the SQL Server database.
<td align="left"><%=rs("Commen
The table cell becomes too big when the Comments field contains too many characters. Is it possible to display only the first 50 characters of each record, then when the TD is clicked, it expands and shows the full record? When a different record is clicked it collapses to show the first 50 characters only.
My page is written is Classic ASP.
Thank you for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'll have a look at this tomorrow
ASKER
Thank you very much, I figured out the rest. It's actually a better solution than I was hoping for.
ASKER
I'm afraid I will need some more help. I'm struggling to make the page appear with the short version of the Comments field. My goal is to expand it when clicked. I don't want to click the table header because that is supposed to sort the records. I would like the short Comments and long Comments alternate when the TD is clicked. Please take a look at the complete code of my page. How should I modify it in order to achieve my goal? I tried changing the colspan and the p to B and I, but whenever I placed those tags in my table the content just disappeared, but the TD was still visible.
Open in new window