Applying CSS styles in an unusual circumstance

I have sections of sites that basically display database tables. I
use a piece of script that outputs fields in a form based on the
field types as defined in the database into s. Long varchars are
wide; short ones are narrow, enums are pop-ups/checkbox/radio if
modifiable etc. In text circumstances where the field a modifiable it
is output into an within its . The length/width of the
input box being determined from the database definitions, currently
by including the deprecated/removed width= attribute.

I’m re-doing this for newer versions of HTML and so want to drop the
width attribute. Other than just changing the attribute to
style=“width:xxx” is there a better way to add widths at a ‘further
out’ level when the required width is determined dynamically at the
same time as the content?

Also, does anyone know where there is a list of all modern style
attributes that are applicable to specific tags? w3schools used to do
it, but they’ve dumbed it all down now the possibilities are much
greater. For example I expect that the ‘width’ style for an
is no longer “width”, but I can’t find out what the proper term now
is.

David


David Ledger - Freelance Unix Sysadmin in the UK.
email@hidden
www.ivdcs.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

An input is generally sized with the size=[characters] format attribute, nothing else. You can also drop this attribute, or override with inline CSS styling if you want a more consistent dimension.

<input size="30" name="foo" />
<input style="width: 200px" name="bar" />

If you really need absolute control over a mix of input types, then using the Box-Sizing Action on the page will be an enormous help. Otherwise, there’s really no good way to get a mix of inputs and text areas to have the same dimensions/appearance:

<input size="30" name="string" />
<textarea cols="30" rows="15" name="para"></textarea>

Those two will be wildly different widths, even though they are using what would appear to be the same metrics (characters of text) to do their dimensioning. But these two will also be off, albeit by a smaller delta:

<input style="width: 200px" name="string" />
<textarea style="width: 200px" rows="15" name="para"></textarea>

Walter

On Feb 6, 2014, at 11:39 AM, David Ledger wrote:

I have sections of sites that basically display database tables. I use a piece of script that outputs fields in a form based on the field types as defined in the database into s. Long varchars are wide; short ones are narrow, enums are pop-ups/checkbox/radio if modifiable etc. In text circumstances where the field a modifiable it is output into an within its . The length/width of the input box being determined from the database definitions, currently by including the deprecated/removed width= attribute.

I’m re-doing this for newer versions of HTML and so want to drop the width attribute. Other than just changing the attribute to style=“width:xxx” is there a better way to add widths at a ‘further out’ level when the required width is determined dynamically at the same time as the content?

Also, does anyone know where there is a list of all modern style attributes that are applicable to specific tags? w3schools used to do it, but they’ve dumbed it all down now the possibilities are much greater. For example I expect that the ‘width’ style for an is no longer “width”, but I can’t find out what the proper term now is.

David


David Ledger - Freelance Unix Sysadmin in the UK.
email@hidden
www.ivdcs.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options