Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ot - CSS Table Widths

Reply
Thread Tools

ot - CSS Table Widths

 
 
Harag
Guest
Posts: n/a
 
      08-07-2003
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
 
Reply With Quote
 
 
 
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      08-07-2003
> 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.


 
Reply With Quote
 
 
 
 
CJM
Guest
Posts: n/a
 
      08-08-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
Harag
Guest
Posts: n/a
 
      08-08-2003
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
 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      08-08-2003
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to apply different widths to textboxes and dropdowns using css Greg HTML 0 07-03-2007 02:23 PM
VS.net, design view, and 100% table widths darrel ASP .Net 1 01-26-2005 06:28 PM
Unable to set server side table's cell widths as percentages Dot net work ASP .Net 2 05-20-2004 12:56 PM
More Elegant Column Widths in ASP:Table Objects? =?Utf-8?B?QWxleCBNYWdoZW4=?= ASP .Net 1 05-14-2004 07:38 PM
MIVA and table widths Luke Crouch HTML 0 08-07-2003 03:18 AM



Advertisments