ot - CSS Table Widths

Discussion in 'ASP General' started by Harag, Aug 7, 2003.

  1. Harag

    Harag Guest

    Hi all

    First let me apologize for writing in this news group as its the only
    main one I read.

    I got a CSS style

    ..SetButton {width: 100px; background:url(mybackbutton.gif)}

    now I got a table with each TD with the above class
    <TABLE><TR>
    <TD CLASS=SetButton>Button1
    <TD CLASS=SetButton>Button2
    <TD CLASS=SetButton>Button3
    <TD CLASS=SetButton>Button4
    <TD CLASS=SetButton>Button5
    </TABLE>
    it works great in IE the table is set to 500 px (100x5) and stays 500
    px even when the browser width <500 px

    now I also got NS 7 and test it on there

    problem is:

    when NS browser width <500 then it starts shrinking the table till the
    text fits before it puts its bottom horizontal scroll bar on.

    Now I could put a 100x1 pixel image in each cell but I dont want to do
    this as the width can be variable in above style. ( the width is wrote
    out by my ASP vbscript code for differnt things.

    thanks for any help in advance

    Al
    Harag, Aug 7, 2003
    #1
    1. Advertising

  2. > Why can't the width of the image be variable? Never underestimate the
    value
    > of a 1x1 clear .gif:
    >
    > <IMG SRC="clear.gif" HEIGHT="1" WIDTH="<%=imgWidth%>">


    Or, to prevent it from showing (e.g. if images are disabled and/or outlines
    are on), modify the hspace / vspace parameters instead of the width /
    height.
    Aaron Bertrand - MVP, Aug 7, 2003
    #2
    1. Advertising

  3. Harag

    CJM Guest

    I'm 100% on what the problem is/what you are trying to do, but if you want a
    proper CSS solution to this you ought to post a link so we can see the page
    in action.

    CJM

    "Harag" <> wrote in message
    news:...
    > Hi all
    >
    > First let me apologize for writing in this news group as its the only
    > main one I read.
    >
    > I got a CSS style
    >
    > .SetButton {width: 100px; background:url(mybackbutton.gif)}
    >
    > now I got a table with each TD with the above class
    > <TABLE><TR>
    > <TD CLASS=SetButton>Button1
    > <TD CLASS=SetButton>Button2
    > <TD CLASS=SetButton>Button3
    > <TD CLASS=SetButton>Button4
    > <TD CLASS=SetButton>Button5
    > </TABLE>
    > it works great in IE the table is set to 500 px (100x5) and stays 500
    > px even when the browser width <500 px
    >
    > now I also got NS 7 and test it on there
    >
    > problem is:
    >
    > when NS browser width <500 then it starts shrinking the table till the
    > text fits before it puts its bottom horizontal scroll bar on.
    >
    > Now I could put a 100x1 pixel image in each cell but I dont want to do
    > this as the width can be variable in above style. ( the width is wrote
    > out by my ASP vbscript code for differnt things.
    >
    > thanks for any help in advance
    >
    > Al
    CJM, Aug 8, 2003
    #3
  4. Harag

    Harag Guest

    Thanks guys for replying but the 2 ideas you said I already thought of
    and dismissed. let me explain a bit more.


    I got a vbscript class that will generate html code in a table either
    vertical or horizontal and in each cell it creates buttons.

    now I tell the class what "style" to make these buttons so when it
    creates the menu of buttons it uses the "style" for the class.

    eg
    <TR>
    <TD ID=MainMenu_1 CLASS=MenuStyle_1_OFF onmouseover="togglemenu(this)"
    onmouseout="offmenu(this)" onclick="location="file.asp">Button
    Text1</TD>
    <TD ID=MainMenu_2 CLASS=MenuStyle_1_OFF onmouseover="togglemenu(this)"
    onmouseout="offmenu(this)" onclick="location="file.asp">Button
    Text2</TD>
    <TD ID=MainMenu_3 CLASS=MenuStyle_1_OFF onmouseover="togglemenu(this)"
    onmouseout="offmenu(this)" onclick="location="file.asp">Button
    Text3</TD>

    the above is created from my asp vbscript class when i put
    "clsMenu.display"

    now the togglemenu code is as you might guess javascript this goes
    through all the elements with the same ID (ignoring the number) and
    basically turns the class of the element to the same name but adds
    _OFF on the end. Then when its done that the current element ("this")
    classname = the same class but with the word _ON at the end instead of
    "_OFF"

    the end result is that it produces 3 highlighting buttons as you move
    your mouse over and only uses 2 "blank" images (rather than 6 (2 for
    each button))

    in my css I have 2 styles for each "look" i want one for OFF and one
    for ON and thats where the "WIDTH" & "HEIGHT" is stored as well as
    text color/size/weight/font etc

    So really the only thing I can think of on making NS keep the cells at
    the requested width was to use the width:100px; in the css but as said
    before when NS browser is < width of all the buttons (due to user
    resizing)

    thanks for any more help.

    Al
    Harag, Aug 8, 2003
    #4
  5. Harag

    Evertjan. Guest

    Harag wrote on 07 aug 2003 in microsoft.public.inetserver.asp.general:
    > First let me apologize for writing in this news group as its the only
    > main one I read.


    Please keep on topic.

    The best css NG is:

    netscape.public.dev.css

    Always accessable via:

    <http://groups.google.com/groups?q=netscape.public.dev.css>

    More quit is:

    microsoft.public.siteserver.css

    <http://groups.google.com/groups?q=microsoft.public.siteserver.css>

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Aug 8, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QWxleCBNYWdoZW4=?=

    More Elegant Column Widths in ASP:Table Objects?

    =?Utf-8?B?QWxleCBNYWdoZW4=?=, May 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    552
    Jason DeFontes
    May 14, 2004
  2. Dot net work
    Replies:
    2
    Views:
    1,563
    Dot Net Work
    May 20, 2004
  3. darrel
    Replies:
    1
    Views:
    273
    Eliyahu Goldin
    Jan 26, 2005
  4. Luke Crouch

    MIVA and table widths

    Luke Crouch, Aug 7, 2003, in forum: HTML
    Replies:
    0
    Views:
    347
    Luke Crouch
    Aug 7, 2003
  5. Greg
    Replies:
    0
    Views:
    425
Loading...

Share This Page