Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How is a text button width set?

Reply
Thread Tools

How is a text button width set?

 
 
Pengiun3
Guest
Posts: n/a
 
      10-12-2003
Hello,

I have a table that includes a set of buttons with various text. I
want the buttons in a column to all have the same width (of the widest
button). I've been through several tutorials and even read a few sites
source. I've not found the proper keywords.

The following buttons have various widths. I'd like them to all have
the width of the column. How should I change these?

<input type=\"submit\" name=\"Change\" value=\"Change\">
<input type=\"submit\" name=\"Delete\" value=\"Delete\">
<input type=\"submit\" name=\"Add/Edit\" value=\"Add/Edit\">

Thank you,

David

 
Reply With Quote
 
 
 
 
brucie
Guest
Posts: n/a
 
      10-12-2003
In post <(E-Mail Removed)>
Pengiun3 said...

> The following buttons have various widths. I'd like them to all have
> the width of the column. How should I change these?


input{width:100%;} will make the buttons the width of their container.
(if the browser supports it)




--
brucie.
12/October/2003 08:02:59 pm
 
Reply With Quote
 
 
 
 
Pengiun3
Guest
Posts: n/a
 
      10-12-2003
Brucie,

That doesn't work for me. I'm viewing with Netscape on linux RH8 at
the moment. I don't have a WinMachine with IE to check it right now.
I'd like to find something that would work on most browsers.

David

brucie wrote:
> In post <(E-Mail Removed)>
> Pengiun3 said...
>
>
>> The following buttons have various widths. I'd like them to all have
>>the width of the column. How should I change these?

>
>
> input{width:100%;} will make the buttons the width of their container.
> (if the browser supports it)


 
Reply With Quote
 
brucie
Guest
Posts: n/a
 
      10-12-2003
In post <(E-Mail Removed)>
Pengiun3 said...

>>> The following buttons have various widths. I'd like them to all have
>>>the width of the column. How should I change these?


>> input{width:100%;} will make the buttons the width of their container.
>> (if the browser supports it)


> That doesn't work for me. I'm viewing with Netscape on linux RH8 at
> the moment. I don't have a WinMachine with IE to check it right now.
> I'd like to find something that would work on most browsers.


it should be fine. NS version? URL?

please don't toppost
How am I supposed to post my replies in a newsgroup?:
http://allmyfaqs.com/faq.pl?How_to_post

--
brucie.
12/October/2003 09:39:13 pm
 
Reply With Quote
 
Pengiun3
Guest
Posts: n/a
 
      10-14-2003
brucie wrote:
> In post <(E-Mail Removed)>
> Pengiun3 said...
>
>
>>>> The following buttons have various widths. I'd like them to all have
>>>>the width of the column. How should I change these?
>>>

>
>>>input{width:100%;} will make the buttons the width of their container.
>>>(if the browser supports it)

>>

>
>> That doesn't work for me. I'm viewing with Netscape on linux RH8 at
>>the moment. I don't have a WinMachine with IE to check it right now.
>>I'd like to find something that would work on most browsers.

>
>
> it should be fine. NS version? URL?


Hmm, Mozilla 1.0.1 on linux RH8. Netscape 4.61 on OS/2. IE6 on Windows.

I've posted the mock up on http://4.7.104.9/Index.html

Thank you,

David

 
Reply With Quote
 
Toby A Inkster
Guest
Posts: n/a
 
      10-14-2003
Pengiun3 wrote:

> I've posted the mock up on http://4.7.104.9/Index.html


which contains:

<td><input{width:100%;} type="submit" name="UID2 Change"
value="Change"></td>

Ah I think you mean:

<td><input style="width:100%;" type="submit" name="UID2 Change"
value="Change"></td>

or better still, between <head> and </head>:

<style type="text/css" media="screen,projection">
input.wide { width:100%; }
</style>

and then for your input element:

<td><input class="wide" type="submit" name="UID2 Change"
value="Change"></td>

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      10-14-2003
Sometime around Tue, 14 Oct 2003 07:57:52 +0100, Toby A Inkster is reported
to have stated:

> or better still, between <head> and </head>:
>
> <style type="text/css" media="screen,projection">
> input.wide { width:100%; }
> </style>


Or better again,

<link rel="stylesheet" href="foo.css" media="screen,projection">

And in foo.css:

input.wide { width:100%; }




--
Mark Parnell
http://www.clarkecomputers.com.au
 
Reply With Quote
 
Pengiun3
Guest
Posts: n/a
 
      10-15-2003
Toby A Inkster wrote:
> Pengiun3 wrote:
>
>
>>I've posted the mock up on http://4.7.104.9/Index.html

>
>
> which contains:
>
> <td><input{width:100%;} type="submit" name="UID2 Change"
> value="Change"></td>
>
> Ah I think you mean:
>
> <td><input style="width:100%;" type="submit" name="UID2 Change"
> value="Change"></td>
>
> or better still, between <head> and </head>:
>
> <style type="text/css" media="screen,projection">
> input.wide { width:100%; }
> </style>
>
> and then for your input element:
>
> <td><input class="wide" type="submit" name="UID2 Change"
> value="Change"></td>


Thanks Toby. That worked for me. I'm still rather new to HTML 4 and
below. I hadn't read much about CSS so it hadn't occured to me to look
there for an answer. I was hoping there was a variant of the size
parameter.

David

 
Reply With Quote
 
Pengiun3
Guest
Posts: n/a
 
      10-15-2003
Mark Parnell wrote:
> Sometime around Tue, 14 Oct 2003 07:57:52 +0100, Toby A Inkster is reported
> to have stated:
>
>
>>or better still, between <head> and </head>:
>>
>><style type="text/css" media="screen,projection">
>>input.wide { width:100%; }
>></style>

>
>
> Or better again,
>
> <link rel="stylesheet" href="foo.css" media="screen,projection">
>
> And in foo.css:
>
> input.wide { width:100%; }
>
>
>



Thanks Mark.

I'll read up on CSS. I was hoping not to rely on too many new
technologies. I'd like to support even old browsers. But all this
seems to be compatible so its well worth including.

David

 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      10-15-2003
Sometime around Wed, 15 Oct 2003 00:58:31 GMT, Pengiun3 is reported to have
stated:

> Thanks Mark.
>


You're welcome.

> I'll read up on CSS.


Well worth the effort. Ask brucie for some links.

> I was hoping not to rely on too many new
> technologies.


CSS is hardly new - the CSS1 specs were published in 1996, and CSS2 (the
current version) in 1998.

> I'd like to support even old browsers. But all this
> seems to be compatible so its well worth including.


CSS is ideal because browsers that don't understand it still get full
access to the content. Except browsers like NS4, which pretend to
understand it, and screw it up completely. But it is easy enough to hide
the CSS from non-conforming browsers - see
http://w3development.de/css/hide_css_from_browsers/

--
Mark Parnell
http://www.clarkecomputers.com.au
 
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
Localization - Automating Button Text + Button Width Robert Cramer ASP .Net 1 03-11-2008 12:14 AM
Drop Down List Border Width vs Text Box Border Width Coder ASP .Net 1 06-24-2006 01:27 PM
Textbox width scaling to width of data not width of page? AndrewF ASP .Net 1 10-10-2005 04:38 PM
JComboBox width, dropdown list width Xu Java 11 07-15-2005 11:54 PM
Re: resized image in table extends table width to original image width Sean Jorden HTML 1 08-19-2003 08:59 AM



Advertisments