Wrox Programmer Forums
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 2nd, 2005, 08:03 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default Scrollbar in "Table"

Hi All,

I haven't seen it, but is it possible to have a Scrollbar option in "Table"?
Otherwise, is there any third party component available?

Thanks for your help,

mcinar


__________________
MCinar

Love all the creatures because of the creator.
 
Old January 2nd, 2005, 10:34 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i believe you can use iframes.

<iframe frameborder="0" name="content" width="685" height="382" marginheight="5" marginwidth="5" scrolling="auto" src="content.html"></iframe>

 
Old January 3rd, 2005, 01:31 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you, Gingar.
It is a helpful information.

mcinar

 
Old January 3rd, 2005, 03:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Alternatively, you can use a <div> tag with the CSS overflow property set to auto. You'll need to put the column headings outside the <div> in a separate, same sized, table, like this:
Code:
<table style="width: 300px" cellpadding="0" cellspacing="0">
<tr>
    <td>Column 1</td>
    <td>Column 2</td>
</tr>
</table>
<div style="overflow: auto;height: 100px; width: 330px;">
<table style="width: 300px;" cellpadding="0" cellspacing="0">
<tr>
    <td>Value 1</td>
    <td>Value 2</td>
</tr>
<tr>
    <td>Value 1</td>
    <td>Value 2</td>
</tr>
<tr>
    <td>Value 1</td>
    <td>Value 2</td>
</tr>
<tr>
    <td>Value 1</td>
    <td>Value 2</td>
</tr>
<tr>
    <td>Value 1</td>
    <td>Value 2</td>
</tr>
<tr>
    <td>Value 1</td>
    <td>Value 2</td>
</tr>
</table>
</div>
Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Analog Worms Attack by Mr. Oizo (Track 1 from the album: Analog Worms Attack) What's This?
 
Old January 4th, 2005, 10:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thank you, Imar.
It will be very helpful.

mcinar

 
Old January 13th, 2005, 01:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Your information is very helpful and it works.
I tried to use "style="overflow: auto;" in <div> for my codes, but it doesn't show the
scroll bars. Here is my code;

<%
sub display_authorized_user(rs)
    %>
    <div id="authorized_user_title" width ="300px" style="position:absolute; left: 380px; top: 220px;">
        <table border="0" rules="NONE">
                <tr>
                    <td class=td2 style="background-color:#000099; color=#FFFFFF;">AUTHORIZED USERS</td>
                </tr>
            </table>
    </div>

    <div id="authorized_user_2" width ="300px" height="50px" style="overflow: auto; position:absolute;left: 310px; top: 245px;">
        <table width="300px" height="50px" cellspacing="0" cellpadding="0" border="1" RULES="NONE">
            <% intCount = 0
                do while not rs.eof
                    if (intCount mod 2) = 0 then%>
                        <tr valign="top" class="tdleft" bgcolor="#ffffff">
                    <%else %>
                        <tr valign="top" class="tdleft" bgcolor="#dddddd">
                    <%end if

                    intCount = intCount + 1

                    call display_detail(rs)%>

                    </tr>

                <%rs.movenext
            loop%>
        </table>
    </div>
<%end sub%>



<%sub display_detail(rs)%>
    <td class=td2>
        <%
            strName = trim(FORMAT_FROM_DB(rs("First_Name_VC"))) & " " & trim(FORMAT_FROM_DB(rs("Last_Name_VC")))

            Response.Write "<a href=update_billing.asp?Authorized_User_ID=" & rs("Authorized_User_ID") & _
                                "&" & "Corp_ID=" & lngCorpID & "&" & "Update_Type=" & strUpdateType & ">" & _
                                strName & "</a>"%>
    </td>
<%end sub%>

Thanks for your help.

mcinar



 
Old January 13th, 2005, 01:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar,

I also tried to use "iframe". It works good. Only problem that I am having is I have a hyperlink field in the "iframe" and when you click on it, it calls another page.
But what it does, instead of bringing a new page it shows that page in the "iframe"

here is my code;

UPDATE_BILLING.ASP (with iframe):

It will be calling "display_authorized_user.asp" and this page has a hyperlink.

<%
sub display_authorized_user_2%>
    <div id="authorized_user_title" width ="300px" style="position:absolute; left: 380px; top: 220px;">
        <table border="0" rules="NONE">
                <tr>
                    <td class=td2 style="background-color:#000099; color=#FFFFFF;">AUTHORIZED USERS</td>
                </tr>
            </table>
    </div>

    <div id="authorized_user" width ="300px" style="position:absolute; left: 310px; top: 245px;">
            <!--
            <iframe frameborder="1" name="content" width="1000px" height="200px"
                marginheight="5" marginwidth="5" scrolling="yes" src="display_billing_instruction.asp?Corp_ID=<%=ln gCorpID%>">
            </iframe> -->
            <iframe frameborder="1" name="authorized_user" width="300px" height="260px" marginheight="0" marginwidth="1"
                 scrolling="yes" src="display_authorized_user.asp?User=ADMIN&Corp_I D=<%=lngCorpID%>&Update_Type=<%=strUpdateType%>">
            </iframe>
    </div>
<%end sub%>

DISPLAY_AUHORIZED_USER.ASP:

<%sub display_detail(rs)%>
    <td class=td2>
        <%
            strName = trim(FORMAT_FROM_DB(rs("First_Name_VC"))) & " " & trim(FORMAT_FROM_DB(rs("Last_Name_VC")))

            if strUser = "ADMIN" then
                Response.Write "<a href=update_billing.asp?Authorized_User_ID=" & rs("Authorized_User_ID") & _
                                                    "&" & "Corp_ID=" & lngCorpID & "&" & "Update_Type=" & strUpdateType & _
                                                    "target=_blank & ">" & _
                                                    strName & "</a>"
            else
                    if len(trim(strName)) then
                        Response.Write strName
                        'Response.Write format_from_db(rs("name_1_vc"))
                    else
                        Response.Write "&nbsp;"
                    end if
            end if%>
    </td>
<%end sub%>


Thanks for your help,

mcinar



 
Old January 13th, 2005, 02:23 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by mcinar
 I tried to use "style="overflow: auto;" in <div> for my codes, but it doesn't show the
scroll bars.
I think you must specify width/height for this to work, it has to know what it is overflowing.

--

Joe (Microsoft MVP - XML)
 
Old January 13th, 2005, 03:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 141
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi joefawcett,
thank you for your reply.
I am specifying the width and height.

Here is the complete code;

<%
sub display_authorized_user(rs)
    %>
    <div id="authorized_user_title" width ="300px" style="position:absolute; left: 380px; top: 220px;">
        <table border="0" rules="NONE">
                <tr>
                    <td class=td2 style="background-color:#000099; color=#FFFFFF;">AUTHORIZED USERS</td>
                </tr>
            </table>
    </div>

    <div id="authorized_user_2" width ="300px" height="50px" style="overflow: auto; position:absolute;left: 310px; top: 245px;">
        <table width="300px" height="50px" cellspacing="0" cellpadding="0" border="1" RULES="NONE">
            <% intCount = 0
                do while not rs.eof
                    if (intCount mod 2) = 0 then%>
                        <tr valign="top" class="tdleft" bgcolor="#ffffff">
                    <%else %>
                        <tr valign="top" class="tdleft" bgcolor="#dddddd">
                    <%end if

                    intCount = intCount + 1

                    call display_detail(rs)%>

                    </tr>

                <%rs.movenext
            loop%>
        </table>
    </div>
<%end sub%>



<%sub display_detail(rs)%>
    <td class=td2>
        <%
            strName = trim(FORMAT_FROM_DB(rs("First_Name_VC"))) & " " & trim(FORMAT_FROM_DB(rs("Last_Name_VC")))

            Response.Write "<a href=update_billing.asp?Authorized_User_ID=" & rs("Authorized_User_ID") & _
                                "&" & "Corp_ID=" & lngCorpID & "&" & "Update_Type=" & strUpdateType & ">" & _
                                strName & "</a>"%>
    </td>
<%end sub%>


Thanks for your help,

MCinar


 
Old January 13th, 2005, 03:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Just as in my example, you need to set the width of the outer div to be larger than the inner table. The difference between the two is the width of the scrollbar....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: My Morning Song by The Black Crowes (Track 9 from the album: The Southern Harmony And Musical Companion) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to center a table with scrollbar Sickopuppie HTML Code Clinic 5 June 15th, 2006 02:43 AM
add scrollbar to table MAntis_sg Classic ASP Basics 3 May 18th, 2006 11:36 AM
problem with scrollbar and a table header touyets CSS Cascading Style Sheets 2 August 29th, 2005 12:18 AM
problem with scrollbar and a table header touyets HTML Code Clinic 0 August 25th, 2005 06:45 AM
Scrollbar in "Table" mcinar Classic ASP Basics 7 January 2nd, 2005 09:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.