Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Why can't I change height with <col width="50" height="100">?

Reply
Thread Tools

Why can't I change height with <col width="50" height="100">?

 
 
Bernd Meier
Guest
Posts: n/a
 
      01-13-2008
Why has the value of height no consequences in the below example?
If I change width I get changes but not if I change height.

<html>
<head>
<title>HTML-Test</title>
</head>
<body>
<h3>HTML-Test</h3>
<table border="5">
<colgroup>
<col width="50" height="100">
<col width="50" height="100">
<col width="50" height="100">
</colgroup>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
</table>
</body>
</html>
 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      01-13-2008
Bernd Meier wrote:

> Why has the value of height no consequences in the below example?


Becuase there is no height attribute for the col element.

Check with the HTML spec at http://w3.org/TR/html4/ and the Markup Validator
at http://validator.w3.org/

--
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
 
Reply With Quote
 
 
 
 
Bernd Meier
Guest
Posts: n/a
 
      01-13-2008
>> Why has the value of height no consequences in the below example?

> Becuase there is no height attribute for the col element.


Is there another element for col to change the height?

Or is there no possibility to do it because auf logical reseans?

Because if I would change the cell hights in one column I also have to
change
the cell hights of the next columns?

 
Reply With Quote
 
John Hosking
Guest
Posts: n/a
 
      01-13-2008
Bernd Meier wrote:
> Why has the value of height no consequences in the below example?
> If I change width I get changes but not if I change height.


Because you're making things up.

Prefatory remark 1: Providing a URL is better than posting code, because
1) the URL is usually shorter,
2) the URL lets us see, for example, what doctype you're using, and
3) we can immediately try out your code in our browsers, without
copy-and-paste or guessing from just looking at your code.

Prefatory remark 2: Below I mention the recommmendation for HTML 4.01
because I don't know what you think you're using. No URL, you see.


> <colgroup>
> <col width="50" height="100">


Take a look at the W3C's description of the <col> element at
<http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.2>.
There is no height attribute for <col>. You've just made it up.

You'd have to specify the width directly to the TDs (and hope for the
best), although in practice you can usually specify width for <TD>
elements in one row, and all the columns in the rest of the table make
similar use of those widths (depending on the actual content, as always).


--
John
Pondering the value of the UIP: http://improve-usenet.org/
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      01-13-2008
Scripsit Bernd Meier:

> Is there another element for col to change the height?


No.

> Or is there no possibility to do it because auf logical reseans?


One might say so. Why would you set the height of columns instead of
simply setting the height of the table?

> Because if I would change the cell hights in one column I also have to
> change
> the cell hights of the next columns?


Pardon? Did you expect to change the height of each _cell_ in the
columns?

The practical way to make the cells in a column have the same width is
to use a class="..." attribute for the cell elements and to set the
height of the cells in a style sheet.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

 
Reply With Quote
 
Adrienne Boswell
Guest
Posts: n/a
 
      01-13-2008
Gazing into my crystal ball I observed "Bernd Meier" <ndkwinklask263
@yahoo.de> writing in news:fmdbv5$429$(E-Mail Removed):

>>> Why has the value of height no consequences in the below example?

>
>> Becuase there is no height attribute for the col element.

>
> Is there another element for col to change the height?
>
> Or is there no possibility to do it because auf logical reseans?
>
> Because if I would change the cell hights in one column I also have to
> change
> the cell hights of the next columns?
>


Because tables are for tabular data, there really is no reason for a
height attribute - rows expand/shrink to fit their contents, as it
should be. Authors got into the bad habit of using tables for
positioning content - but that is not what tables are for. HTML should
not be presentational - that's what CSS is for.

Unless you have a _very_ good reason for setting height, let the table
do what it supposed to do.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

 
Reply With Quote
 
GTalbot
Guest
Posts: n/a
 
      01-14-2008
On 13 jan, 10:08, "Bernd Meier" <(E-Mail Removed)> wrote:
> Why has the value of height no consequences in the below example?
> If I change width I get changes but not if I change height.
>
> <html>


No doctype declaration. You will trigger modern browsers into quirks
mode, not standards compliant rendering mode.

Using Web Standards in your Web Pages: Making your page using web
standards - how to
http://developer.mozilla.org/en/docs...dards_-_how_to

As others told you, there is no height attribute for <col>. And the
styling the <col> in Internet Explorer 6 and in Internet Explorer 7 is
rather unreliable, prone to layout bugs.

http://www.gtalbot.org/BrowserBugsSe...IE7Bugs/#bug25

http://www.gtalbot.org/BrowserBugsSe...IE7Bugs/#bug28

Looking for a constrained height on a table is most likely misusing
tables to begin with. Adrienne B. gave you an excellent answer,
exactly the kind of answer I would have given you.

If you want help with your webpage design, then start with providing
us with an url and a short, descriptive, meaningful explanation of
what you are truly trying to achieve, with natural words, not with
code explanations. Maybe you want/need a navigational horizontal list
of 3 links... we don't know..

Otherwise:

Table-based webpage design versus CSS-based webpage design: resources,
explanations and tutorials
http://www.gtalbot.org/NvuSection/Nv...CSSDesign.html

CSS webpage templates
http://www.gtalbot.org/NvuSection/Nv...bpageTemplates

CSS webpage templates
http://fabiwan.kenobi.free.fr/css/PageLayout.html

CSS webpage templates
http://fabiwan.kenobi.free.fr/css/PageLayout2.html

KazGarden (CSS webpage templates)
http://www.gimp-werkstatt.de/kaze/

Regards,

Gérard
 
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
textbox height different than input height tshad ASP .Net 1 03-08-2007 10:04 PM
why why why why why Mr. SweatyFinger ASP .Net 4 12-21-2006 01:15 PM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
measuring web controls height at runtime (or converting .height % to px) Wotney ASP .Net 1 10-25-2006 01:39 PM
how to get specific cell height without hard-coding a height value laredotornado@zipmail.com HTML 0 08-19-2006 08:13 PM



Advertisments