473,659 Members | 2,582 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to detect table width or height?

Is there some way --using, say, DOM or javascript-- to detect the
current pixel width and/or height of a relatively sized table or of
one of its columns or rows. I'm going to be writing javascript to
adjust my page to the viewer's browser window dimensions and this
would sure be great information to have.

Thanks ....
Dennis
Jul 20 '05
157 16365
Barry Pearson wrote:
Brian wrote:

Ensure that your read the following, which didn't get an answer from Brian.
Was I under some obligation? Why didn't anyone tell me?
It asks how a person should decide what size to make
pixel-oriented content such as images & photographs:
http://groups.google.c om/gr************* *************** ****@newsfep1-gui.server.ntli .ne
http://tinyurl.com/qkqe
Oh, one more thing: how much will you pay me when I provide the answer
you feel you deserve?
Have a look at one of Brian's own pages:
http://people.umass.edu/btrembla/jardin/garden.html
http://tinyurl.com/qkqt

If you view that page, and contract the window on your
browser, you will find that, at about 864 viewport pixels,
a horizontal scroll-bar appears.
This is a flaw in the redesign of my site, in which I moved the
navigation from the top to the left of the window, causing a
horizontal scroll bar with that big picture. I'd like to thank you
for pointing it out, but I get the impression that it's intended to
denigrate my work.
I cannot fault Brian's decision to base his image size on
the screen sizes of the vast majority of web users. IF
that is how he arrived at the particular size!
It isn't. I don't cater to any screen size.
(I hope he didn't simply make a random decision).


You could just ask me, of course. You didn't, but in case the
suspense is killing you, here's how I arrived at my decision: I made
the photo as small as I could, both by cropping and shrinking, while
maintaining the composition of the photo and keeping the detail.

Now, if you'll excuse me, I must go rethink the css on my site.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #11
Brian wrote:
Barry Pearson wrote:

Ensure that your read the following, which didn't get an answer from
Brian.


Was I under some obligation? Why didn't anyone tell me?


Lost your way Brian?

You've been seconded to the help desk - remember? Just down the hall,
second on the left.

---------------->

--
William Tasso - http://WilliamTasso.com
Jul 20 '05 #12
William Tasso wrote:

You've been seconded to the help desk


I don't quite get that. I've been "seconded?" What does "second"
mean when used as a verb?

--
Brian
follow the directions in my address to email me

Jul 20 '05 #13
In post <Ky3ib.540729$O z4.446392@rwcrn sc54>
Brian said...
You've been seconded to the help desk
I don't quite get that. I've been "seconded?" What does "second"
mean when used as a verb?


its one after being firsted and one before being thirded

--
brucie.
12/October/2003 01:11:26 pm
Jul 20 '05 #14
In article <Ky3ib.540729$O z4.446392@rwcrn sc54> in
comp.infosystem s.www.authoring.html, Brian
<us*****@mangym utt.com.invalid-remove-this-part> wrote:
William Tasso wrote:

You've been seconded to the help desk


I don't quite get that. I've been "seconded?" What does "second"
mean when used as a verb?


http://dictionary.reference.com/search?q=second&db=*
and look at the fourth meaning under tr[ansitive]v[erb]

The acCENT is on the second sylLABle, at least in the past
participle. I've never heard the verb used in the present tense.

The noun form is "seCONDment ":
http://dictionary.reference.com/sear...econdment&db=*

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
2.1 changes: http://www.w3.org/TR/CSS21/changes.html
validator: http://jigsaw.w3.org/css-validator/
Jul 20 '05 #15
Stan Brown wrote:
In article <Ky3ib.540729$O z4.446392@rwcrn sc54> in
comp.infosystem s.www.authoring.html, Brian wrote:
What does "second" mean when used as a verb?


http://dictionary.reference.com/search?q=second&db=*
and look at the fourth meaning under tr[ansitive]v[erb]


Come to think of it, I do know second as a verb, but only the 3rd
meaning, as it pertains to voting. That 4th definition is new to me.

--
Brian
follow the directions in my address to email me

Jul 20 '05 #16
William Tasso wrote:
Brian wrote:
Barry Pearson wrote:
Ensure that your read the following, which didn't
get an answer from Brian.
Was I under some obligation? Why didn't anyone tell me?


Lost your way Brian?


Apparently!
You've been seconded to the help desk - remember?
Oh dear, no, that short-term memory is not what it should be. (after
a little vocabulary help, I get the joke!)
Just down the hall, second on the left.


[hurries to take post behind help desk]

--
Brian
follow the directions in my address to email me

Jul 20 '05 #17
Brian wrote:
Barry Pearson wrote: [snip]
Have a look at one of Brian's own pages:
http://people.umass.edu/btrembla/jardin/garden.html
http://tinyurl.com/qkqt

If you view that page, and contract the window on your
browser, you will find that, at about 864 viewport pixels,
a horizontal scroll-bar appears.


This is a flaw in the redesign of my site, in which I moved the
navigation from the top to the left of the window, causing a
horizontal scroll bar with that big picture. I'd like to thank you
for pointing it out, but I get the impression that it's intended to
denigrate my work.


I've said elsewhere that I like your web sites. I've said the photograph size
is OK. On my screen your web site looks fine.

If there is an implied criticism, it is that the page above (and perhaps
others?) will have a horizontal scroll bar on nearly half of the screens using
the web. The question is, does that matter to you? If you are going to rethink
the CSS on the site, why? After all, you say below you don't cater to any
screen size.

If you had decided (as I do) to cater for people with screens of 800 x 600
(hence maximum viewports a little less than that), you might have ensured that
the web site worked on such screens from the start and tested it on them.
Doesn't it make sense to do so?

Changing the CSS won't stop the horizontal scrolling at 640 x 480 because of
the size of the photograph. It will stop it at 800 x 600. It will make no
difference at 1024 x 768. So changing the CSS sounds as though you want to
cater for the 800 x 600 population. There would be nothing wrong with that!
But you appear to be denying this.
I cannot fault Brian's decision to base his image size on
the screen sizes of the vast majority of web users. IF
that is how he arrived at the particular size!


It isn't. I don't cater to any screen size.
(I hope he didn't simply make a random decision).


You could just ask me, of course. You didn't, but in case the
suspense is killing you, here's how I arrived at my decision: I made
the photo as small as I could, both by cropping and shrinking, while
maintaining the composition of the photo and keeping the detail.


Your choice, of course, but I suspect relatively few other people use that
particular algorithm. Why as small as you can? What value has that to your
viewers? If you had a very simple photograph with little detail, would it be
tiny? If you had massive detail, would it be (say) 1024 x 768, and perhaps
several 100 KB even compressed?

Julie Tremblay clearly doesn't use that algorithm. Her photographs fit into a
400 x 400 pixel box, and often fill it (square). It doesn't matter whether
they are "soft" or "detailed". My guess is that some of her photographs would
look great printed yards across, so the web-size certainly doesn't keep the
detail. I assume she chose that size for some reason, then fitted the
photographs into it, whatever it did to the detail.

Even from 35mm, I lose a lot of detail reducing photographs to 700 x 500
pixels (see below). So I had to use some other reason than "detail" to choose
the size. Obviously screen-size of typical viewers was the most important
criterion. Download time was the second.

http://www.barry.pearson.name/photog...95_26_11_1.htm

http://www.barry.pearson.name/photog...a1_03_25_1.htm
Now, if you'll excuse me, I must go rethink the css on my site.


--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #18
Barry Pearson wrote:

If you had decided (as I do) to cater for people with screens of
800 x 600 (hence maximum viewports a little less than that), you
might have ensured that the web site worked on such screens from
the start and tested it on them. Doesn't it make sense to do so?
No. I do not cater to one resolution. I try to cater to any
resolution. In this case, I failed. I have since changed the css to
make it a little better, but I probably need to make more substantial
changes.
Changing the CSS won't stop the horizontal scrolling at 640 x 480
because of the size of the photograph. It will stop it at 800 x
600. It will make no difference at 1024 x 768.
Are you talking resolution or window size?
So changing the CSS sounds as though you want to cater for the 800
x 600 population.
No. I want to stop making it difficult for those with a smaller
viewport, to the extent that that is possible.
There would be nothing wrong with that!
I can think of no reason to cater to one size window size at the
expense of others.
here's how I arrived at my decision: I made the photo as small as
I could, both by cropping and shrinking, while maintaining the
composition of the photo and keeping the detail.


Why as small as you can?


To make it as accessible as I can.
What value has that to your viewers?
On dialup? Quite a bit, I'd imagine. It sure matters to me when I'm
on dialup.
If you had a very simple photograph with little detail, would it be
tiny?
"tiny" is relative. It would be smaller than the picture of the
entire garden. But heck, why talk of the hypothetical? Look at the
other garden photos. Some are smaller because I was able to crop and
resize them more.
If you had massive detail, would it be (say) 1024 x 768,
That's a resolution, right? Well, I suppose, by coincidence, I might
come up with a photo that is exactly 1024px x 768px.
and perhaps several 100 KB even compressed?
If the content required it, perhaps.
Julie Tremblay clearly doesn't use that algorithm.
How would you know?
Her photographs fit into a 400 x 400 pixel box, and often fill it
(square).
550 x 500, with a border to provide a little visual spacing.
It doesn't matter whether they are "soft" or "detailed". My guess
is that some of her photographs would look great printed yards
across, so the web-size certainly doesn't keep the detail.
Well, not yards, but certainly much larger than you'll see on her
site. According to a page on her site, the largest prints are 30
inches x 30 inches (approximately 80cm x 80cm, I believe).
I assume she chose that size for some reason, then fitted the
photographs into it, whatever it did to the detail.
The size she chose allows a reasonable representation of her photos
while remaining accessible on most computer screens. I doubt that any
handheld device user would be able to easily view the full-sized
photos, but I suppose they could look at the thumbnails. This, of
course, is a restriction imposed by the content.
Even from 35mm, I lose a lot of detail reducing photographs to 700
x 500 pixels (see below).


I don't know much about photography. I know that Julie Tremblay uses
a format larger than 35mm. It might be 3 inches x 5 inches, but I
cannot be sure. I suppose that means that she loses even more detail
than you do, right?

--
Brian
follow the directions in my address to email me

Jul 20 '05 #19
Brian wrote:
Barry Pearson wrote:

If you had decided (as I do) to cater for people with screens of
800 x 600 (hence maximum viewports a little less than that), you
might have ensured that the web site worked on such screens from
the start and tested it on them. Doesn't it make sense to do so?


No. I do not cater to one resolution. I try to cater to any
resolution. In this case, I failed. I have since changed the css to
make it a little better, but I probably need to make more substantial
changes.


With images, you can't satisfactorily cater for any resolution. You eventually
have to make some hard decisions.
Changing the CSS won't stop the horizontal scrolling at 640 x 480
because of the size of the photograph. It will stop it at 800 x
600. It will make no difference at 1024 x 768.


Are you talking resolution or window size?


I tested your site using viewport size (because that is what Firebird tells
me). But the maximum viewport size is typically just a bit less than the
screen size. So I design my photographic site to work with a viewport a little
less than 800 x 600. For example, the photographs may be up to 500 x 500 or
700 x 700 or 700 x 500, depending on the site and the button used.
So changing the CSS sounds as though you want to cater for the 800
x 600 population.


No. I want to stop making it difficult for those with a smaller
viewport, to the extent that that is possible.
There would be nothing wrong with that!


I can think of no reason to cater to one size window size at the
expense of others.


Who is talking about "at the expense of others"? You can design to ensure that
your pages CAN be displayed on a particular viewport size without necessarily
making it worse for the rest (Except for image sizes, which do tend to favour
some at the expense of others). It makes a lot of sense to design yourpages so
that they will display well at 800 x 600.
here's how I arrived at my decision: I made the photo as small as
I could, both by cropping and shrinking, while maintaining the
composition of the photo and keeping the detail.


Why as small as you can?


To make it as accessible as I can.


But a small photograph on a screen displaying very many pixels per inch (eg.
well over 150) will actually not be very good. (Unless the user can cater for
the problem, for example in the way that Opera can show images as well as text
larger). I don't assume that the user has such a browser, so I try to make my
photographs a suitable size even without such a browser.
What value has that to your viewers?


On dialup? Quite a bit, I'd imagine. It sure matters to me when I'm
on dialup.
If you had a very simple photograph with little detail, would it be
tiny?


"tiny" is relative. It would be smaller than the picture of the
entire garden. But heck, why talk of the hypothetical? Look at the
other garden photos. Some are smaller because I was able to crop and
resize them more.
If you had massive detail, would it be (say) 1024 x 768,


That's a resolution, right? Well, I suppose, by coincidence, I might
come up with a photo that is exactly 1024px x 768px.


Not good! I hope you would take advice before do that.
and perhaps several 100 KB even compressed?


If the content required it, perhaps.
Julie Tremblay clearly doesn't use that algorithm.


How would you know?
Her photographs fit into a 400 x 400 pixel box, and often fill it
(square).


550 x 500, with a border to provide a little visual spacing.


I mean - all of her JPEGs are either 400 pixels wide or 400 pixels high or
both.
It doesn't matter whether they are "soft" or "detailed". My guess
is that some of her photographs would look great printed yards
across, so the web-size certainly doesn't keep the detail.


Well, not yards, but certainly much larger than you'll see on her
site. According to a page on her site, the largest prints are 30
inches x 30 inches (approximately 80cm x 80cm, I believe).


The key is her "The photographs presented on this website are digital
representations of prints from 35mm, 120, and 4x5 negatives". I can easily
print at 19" x 13" from 35mm (and have several 20" x 16" Cibachromes on my
walls). So I can confidently say that some of her photographs would look great
printed yards across.
I assume she chose that size for some reason, then fitted the
photographs into it, whatever it did to the detail.


The size she chose allows a reasonable representation of her photos
while remaining accessible on most computer screens. I doubt that any
handheld device user would be able to easily view the full-sized
photos, but I suppose they could look at the thumbnails. This, of
course, is a restriction imposed by the content.


In other words, she took into account the screen sizes of "most computers"!
But I already knew that! She is a photographer - and that is what
photographers have to do. (I personally believe she should have made them
larger, because on some screens they will be little more than 2" across. But
it is her choice).
Even from 35mm, I lose a lot of detail reducing photographs to 700
x 500 pixels (see below).


I don't know much about photography. I know that Julie Tremblay uses
a format larger than 35mm. It might be 3 inches x 5 inches, but I
cannot be sure. I suppose that means that she loses even more detail
than you do, right?


Vastly more. See above. She chooses her sizes on grounds other than "keeping
the detail".

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/
Jul 20 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2141
by: Carl Gilbert | last post by:
Hi I am currently writing a site that utilises tables. I have one page that links to a second page. The only problem is that when I link to the second page, the table loads up with a different height than was set in the code. However, when I use the navigation buttons in IE to go back and then forward again to the second page, the table is displayed as expected.
10
7842
by: John | last post by:
I have a table with two rows. On the first row is a text box and in the second row is an image. I have set the table cellpadding to 0 and cellspacing to 0. The table is leaving extra spaces in the rows on the top and bottom of the picture and image. I need to make the height of the rows to be the same as the textbox and image. How do I do this? I have tried even setting the height of the table and all the <td> and <tr> tags to 1 but have...
1
4316
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a link. 2) The position of this menu is absolute to the page. I want to make it absolute to the Table...
1
2009
by: andrewkooi | last post by:
Greetings, I have 16 links for my horizontal menu navigation as you can see in my website www.singakad.com and at present, I am using a table and javascript for this menu. Is it possible for me to create a submenu for certain cells in this horizontal menu? How do I go about doing this? Thank you in advance for any assistance given.
11
3570
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables but not in height calculations. Oh, and Opera version 8.02 does the same thing. |<-->| |<-->| <------ border |<------------>| <------ table contents
3
2031
by: Chifo | last post by:
hello. i have a problem with a populate html table with data from table here it's the problem two querys retrieving data from table, one of querys show me a colletion of data from 6:00 am to 15:30 pm timestampz, i put this on a part of html table. when time on my if condition es great than 15:31, showme data from 15:31 to 23:59 timestamp and populate another part of html table. but, data in html first part,it's gone away.
5
2108
by: outstretchedarm | last post by:
I'm extremely new to javascript and to programming in general. I am trying to create an interactive table. I have already created the table with constants, in the key of C (it is for music). what I would like to do is to create a dropdown box that would enable the user to select all 12 keys, then based on that choice, have the whole table re-calculate, basically transposing all the data up or down. how would I go about doing this.
2
16407
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using to overlap correctly. You can see it on this page: www.creativekaysjewelry.com The images overlap exactly how I wanted and in the right position
1
5191
by: MissMarie | last post by:
I've been playing around with DIV tables in myspace to better learn how to rewrite my own code for my business site without having to pay someone to design it. I've tried embedding a slideshow into a div table and after I save it I noticed that the slideshow does not show up and the embed code I added is altered. Can anyone help me figure this out? The embed code that I'm talking about is three quarters down the code page under {PHOTOS},...
1
3242
by: azura | last post by:
how can i get this textfield auto detect?? because i try not to using view name button... i want when i enterd this matric no., the student name will appear automatically when i insert the matric no.. <table width="416" height="70" border="1"> <tr> <td width="87" height="33"><strong>Matric No</strong> </td> <td width="7"><div align="center">:</div></td> <td width="300"><input name="matric"...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.