473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Widths and padding / margin..

I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
at http://www.physci.org/test/chem/,
or rather, the table itself is..
http://www.physci.org/test/chem/ptoe.html

It contains valid HTML and CSS
(checked 'moments' ago).

Am testing in IE 6 on XP. My questions..
The 'width' value of table cells seems to have
no effect, can they be set? If so, how?
How can I collapse the gap between cells
containing chemical elements?

TIA

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jul 20 '05 #1
12 3479
In article <CC*********************@news-server.bigpond.net.au>,
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:
I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!)
What do we have here?! A friggin' comedian. :)
a <TABLE>
at http://www.physci.org/test/chem/,
or rather, the table itself is..
http://www.physci.org/test/chem/ptoe.html
Very nice!

It contains valid HTML and CSS
(checked 'moments' ago).
You may want to check again:
<http://validator.w3.org/check?uri=ht...org%2Ftest%2Fc
hem%2Fptoe.html>

Am testing in IE 6 on XP. My questions..
The 'width' value of table cells seems to have
no effect, can they be set? If so, how?
Set the width for a cell, using CSS and don't set any width for the
TABLE element, since it's resulting width will be the sum of the width
of the cells.

If you however insist on the TABLE having an explicit width, then what
do you imagine a browser to behave when you set explicit width for cells?

Back in the days of table-layouts, we often had the following situation:

<table width="100%">
<tr>
<td width="200">..</td><td>..</td>
</tr>
</table>

The table would fit itself to the available width of it's container
(often, the browser window), the first cell would be explicitly 200
pixels wide and the third cell would occupy whatever space was left
within the table's boundaries.

Now, imagine:

<table width="100%">
<tr>
<td width="200">..</td><td width="200">..</td>
</tr>
</table>

What would a browser need to do with this? I find it quite reasonable if
a browser ignores the widths on the cells. Now that we do presentational
things with CSS, it is not really that much different.
How can I collapse the gap between cells
containing chemical elements?


<table ... cellspacing="0">

--
Kris
kr*******@xs4all.netherlands (nl)
Jul 20 '05 #2
*Andrew Thompson* <an******@bigNOSPAMpond.com>:

I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
Hey, I once wanted to do the same to test all the features that HTML4 tables
provide, but quickly lost interest.
The 'width' value of table cells seems to have no effect, can they be set?
Yes.

| Applies to: all elements but non-replaced inline elements, table rows, and row groups

OTOH 'margin' doesn't apply to table-cells and the other internal table
elements.
If so, how?
With the 'width' property either on the cells ('td' or 'th') or the column
('col' or 'colgroup'). You'll probably not be able to see it with the
automatic table algorithm used by default. Try "table-layout: fixed.
How can I collapse the gap between cells containing chemical elements?


border-collapse: collapse;

If you use the value 'separate', you can specify the distance with the
'border-spacing' property. IIRC IE doesn't support the latter.

P.S.: Haven't elements 113 and 114 also been created already?
"Periodic Table of the Elements" should be in 'caption', "(c) Andrew
Thompson, 2003" in 'tfoot' and &copy; exists. It's doubtful that you own
any^Wmuch intellectual property on the data on that page, though.

--
Three things matter in a speech:
who says it, how he says it, and what he says,
and of the three, the last matters least.
Jul 20 '05 #3
In article Andrew Thompson wrote:
I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
at http://www.physci.org/test/chem/,
or rather, the table itself is..
http://www.physci.org/test/chem/ptoe.html

It contains valid HTML and CSS
(checked 'moments' ago).

Am testing in IE 6 on XP. My questions..
The 'width' value of table cells seems to have
no effect, can they be set?
Browser don't do anything as stupid as set all cells 25 em wide, as then
you would get mile long scrollbar.

No sensible browser allows that. You are also using width:100% for table.
How do you expect both happen? If you don't use width:100% for table, and
use small enaugh value for elemenent cell widths (so that whole table
fits viewport), then all cells will be same size. At least in Opera 7.21.
How can I collapse the gap between cells
containing chemical elements?


table {border-collapse:collapse;}
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #4
In article Christoph Paeper wrote:
With the 'width' property either on the cells ('td' or 'th') or the column
('col' or 'colgroup'). You'll probably not be able to see it with the
automatic table algorithm used by default. Try "table-layout: fixed.


Notice that it won't work well (at all really, when trying to use 25em
width for cells) whitout markup changes, as there is only two fixed width
cells on first row and 3 on total. So <col> elements are needed, at
least.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #5
"Kris" <kr*******@xs4all.netherlands> wrote in message
news:kr*****************************@news1.news.xs 4all.nl...
In article <CC*********************@news-server.bigpond.net.au>,
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:
I am developing a Periodic Table of the Elements ..... It contains valid HTML and CSS
(checked 'moments' ago).


You may want to check again:
<http://validator.w3.org/check?uri=ht...org%2Ftest%2Fc
hem%2Fptoe.html>


Dang, that was quick! I blame the Gremlins..

Next try. New versions uploaded (both html and css)
The 'width' value of table cells seems to have
no effect, can they be set? If so, how?


Set the width for a cell, using CSS and don't set any width for the
TABLE element, since it's resulting width will be the sum of the width
of the cells.


TABLE width now gone, ..hmmm seems no different.
(I have applied a width of 500px for the 'el' class)
How can I collapse the gap between cells
containing chemical elements?


<table ... cellspacing="0">


Tah.

I do not quite understand why setting
- margin: 0; - in the CSS had no effect tho,
....ehhh, shrugs.

With the space gone from between cells
and a few slight tweaks to the borders, I am
now quite happy with it.

I have even got used to the slightly 'stretchy / squeezy' *
feel of it that allows it to go quite small (it might
even render on a 640x480 monitor w/out scrollbars
if the browser font size is set to 'smallest').

* Ironically, that was an aspect of the original Applet
on which I based it, that I wanted to avoid in the
html/css version!

See the applet (if you have the Java plug-in) ..here
http://physci.org/applet/PToEApplet.htm

Thanks Kris

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jul 20 '05 #6
Thanks Lauri for your comments, Cristoph covered
most of it so I'll reply to this..

"Christoph Paeper" <cr***********@gmx.net> wrote in message
news:bo***********@ariadne.rz.tu-clausthal.de...
*Andrew Thompson* <an******@bigNOSPAMpond.com>:

I am developing a Periodic Table of the Elements
as<DIV>s ..(chuckle - just kidding!) a <TABLE>
Hey, I once wanted to do the same to test all the features that HTML4

tables provide, but quickly lost interest.
?? Just this one, I promise!
The 'width' value of table cells seems to have no effect, can they be set?
Yes.

| Applies to: all elements but non-replaced inline elements, table rows, and row groups
OTOH 'margin' doesn't apply to table-cells and the other internal table
elements.
If so, how?
With the 'width' property either on the cells ('td' or 'th') or the column
('col' or 'colgroup'). You'll probably not be able to see it with the
automatic table algorithm used by default. Try "table-layout: fixed.


...hmm. I would have to investigate that further before I
clearly understood what you are saying, but the table
is good now.
How can I collapse the gap between cells containing chemical elements?


border-collapse: collapse;


Thank you. I thought there _must_ be a way to do it
in CSS..
If you use the value 'separate', you can specify the distance with the
'border-spacing' property. IIRC IE doesn't support the latter.

P.S.: Haven't elements 113 and 114 also been created already?
Probably.. you'd think they'd be running out of "U's"!
"Periodic Table of the Elements" should be in 'caption', "(c) Andrew
Thompson, 2003" in 'tfoot'
Do you mean to label that cell of the table tfoot, or move
it to the bottom?
and &copy; exists.
yes, sloppy of me..
It's doubtful that you own
any^Wmuch intellectual property on the data on that page, though.


'fixed' ;-)
_________________________________________
With the removal of the '..stupid as set all cells 25 em wide'
bit (..hey, I was _playing_, ok?) the table has settled in nicely.

It reduces down nice and small for small font size.

Thank you all!

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jul 20 '05 #7
Andrew Thompson wrote:

"Christoph Paeper" <cr***********@gmx.net> wrote in message
news:bo***********@ariadne.rz.tu-clausthal.de...
*Andrew Thompson* <an******@bigNOSPAMpond.com>:
I am developing a Periodic Table of the Elements as<DIV>s
..(chuckle - just kidding!) a <TABLE>
OT
Perhaps you should use the <abbr> element for the symbols. That'd make
it quite a bit more functional, no?
How can I collapse the gap between cells containing chemical
elements?


border-collapse: collapse;


Thank you. I thought there _must_ be a way to do it in CSS..


Note that IE 5/Mac does not support this. :( You'll have to resort
to cellspacing for that browser.

--
Brian

Jul 20 '05 #8
"Brian" <us*****@julietremblay.com.invalid-remove-this-part> wrote in
message news:V2bpb.66875$9E1.280354@attbi_s52...
....
*Andrew Thompson* <an******@bigNOSPAMpond.com>:

I am developing a Periodic Table of the Elements as<DIV>s
..(chuckle - just kidding!) a <TABLE>
OT
Perhaps you should use the <abbr> element for the symbols. That'd make
it quite a bit more functional, no?


Tried it for lithium. That is cool.
Looks great in Mozilla 1.3a - does not
seem to work in IE6 though.

Since I will eventually be adding links to each of the
element symbols*, I might simply (and improperly,
as I understand from previous posts) use..
<a href="lithium.jsp" TITLE="Lithium">Li</a>

If it does not work for a particular browser, it
should not be a great loss, since the visitor would
just need click the link for further details in any case.

* I will be ultimately be using JSP and servlets
to extract data from a Java .jar and render it
using 'html' and css. But I find it is best to get
the html and css straight before worrying about
other factors.
How can I collapse the gap between cells containing chemical
elements?

border-collapse: collapse;


Thank you. I thought there _must_ be a way to do it in CSS..


Note that IE 5/Mac does not support this. :( You'll have to resort
to cellspacing for that browser.


Uugghh, alright. I need to do some serious _backwards_
compatibility testing, but I have not decided how far it
is worth pushing it, especially when the information is
technical and readable.

I might have to 'inline' the colors though..

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jul 20 '05 #9
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote in message
news:9y********************@news-server.bigpond.net.au...
"Brian" <us*****@julietremblay.com.invalid-remove-this-part> wrote in
message news:V2bpb.66875$9E1.280354@attbi_s52...


Chemical symbol Li (lithium)...
Perhaps you should use the <abbr> element for the symbols. That'd make
it quite a bit more functional, no?


Tried it for lithium. That is cool.
Looks great in Mozilla 1.3a - does not
seem to work in IE6 though.

Since I will eventually be adding links to each of the
element symbols*, I might simply (and improperly,
as I understand from previous posts) use..
<a href="lithium.jsp" TITLE="Lithium">Li</a>

If it does not work for a particular browser, it
should not be a great loss, since the visitor would
just need click the link for further details in any case.


Scrap that - reconsidered. Since I am prepared
to lose the pop-up text for 'lesser abled' browsers,
I may as well use the <attr> as it seems intended,
and wrap that in an unTitled <a>..
For demonstraion purposes I now have a version
up that uses
<abbr> for lithium
<a title> for beryllium
<a><abbr title> for phosphorus.

I'll go with the format for phosphorus.

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jul 20 '05 #10
In article <vS*********************@news-server.bigpond.net.au>,
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:
If it does not work for a particular browser, it
should not be a great loss, since the visitor would
just need click the link for further details in any case.


Scrap that - reconsidered. Since I am prepared
to lose the pop-up text for 'lesser abled' browsers,
I may as well use the <attr> as it seems intended,
and wrap that in an unTitled <a>..
For demonstraion purposes I now have a version
up that uses
<abbr> for lithium
<a title> for beryllium
<a><abbr title> for phosphorus.

I'll go with the format for phosphorus.


<http://www.xs4all.nl/~apple77/abbr_support/>
Check it in IE/Win. I don't deserve credit for it.

--
Kris
kr*******@xs4all.netherlands (nl)
Jul 20 '05 #11
"Kris" <kr*******@xs4all.netherlands> wrote in message
news:kr*****************************@news1.news.xs 4all.nl...
In article <vS*********************@news-server.bigpond.net.au>,
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:
<abbr>..
If it does not work for a particular browser, it
should not be a great loss, since the visitor would
just need click the link for further details in any case.

... <http://www.xs4all.nl/~apple77/abbr_support/>
Check it in IE/Win. I don't deserve credit for it.


That works nicely in both IE6 and Moz1.3a, so
I got silly and threw NN 4.8 at it, which did not
underline or pop-up (no great surprises there)..
then I checked my current version in NN 4.8. :-0

Need to inline some of those styles.

--
Andrew Thompson
http://www.AThompson.info/
http://www.PhySci.org/
http://www.1point1C.org/
Jul 20 '05 #12
In article <U8*********************@news-server.bigpond.net.au>,
"Andrew Thompson" <an******@bigNOSPAMpond.com> wrote:

[ABBR support]
<http://www.xs4all.nl/~apple77/abbr_support/>
Check it in IE/Win. I don't deserve credit for it.
That works nicely in both IE6 and Moz1.3a, so
I got silly and threw NN 4.8 at it, which did not
underline or pop-up (no great surprises there)..
then I checked my current version in NN 4.8. :-0


I have not thoroughly tested it and as it is now, it is just exactly
what the TITLE says: IE support for ABBR. I will get it (more) right
eventually though.
Need to inline some of those styles.


That should not be too difficult. The script is quite flexible and easy
to change. Again, I don't take credit for that. (check the source for
who does)

--
Kris
kr*******@xs4all.netherlands (nl)
Jul 20 '05 #13

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

Similar topics

3
by: Lars G. Svensson | last post by:
As a regular ciwas reader, I learned that fixed-pixel designs are evil, so for the newly created site http://www.ddc-deutsch.de (in German, still very much under construction) I arranged the...
1
by: B McDonald | last post by:
Hi. There is an inconsistency in the rendering of my side-by-side content and nav columns across the browsers I've tested on. In particular, IE6 renders the margin between the two columns too...
7
by: TheMartian | last post by:
Opera is driving me nuts, I am trying to get it to actually render a table the full width of the browser window sounds easy, but no, Opera and only Opera leaves a 16px margin on the right edge ...
2
by: Oliver Burnett-Hall | last post by:
I'm trying to move to using tableless page layouts, but I've come across what appears to be a bug in IE5's rendering that I can't find a way to overcome. The page has a sidebar to the left of...
3
by: Steve Sabljak | last post by:
I seem to having a little trouble getting a table to display correctly in both msie and firefox. I want to set the table and column widths in pixels, and have some cell padding too. The table...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
10
by: Alan Silver | last post by:
Hello, In my (seemingly) endless quest to understand CSS, I have yet another problem. Please look at http://www.kidsinaction.org.uk/ph/x.html in Opera, where you will see it how I expected. If...
11
by: asllearner | last post by:
I am trying to create two rows, each 100% wide. the first has three dvis, the first is 20% wide, the second is 60% wide, the third is 20% wide. THe second row is the same except the first element...
11
by: sllrphoto | last post by:
A veteran of early html, I've modified my blog template and made it look rather clean (albeit rather plain) when viewed with IE. Ironically, I'm a big Firefox fan, but when viewed in FF, my blog...
19
by: Edward | last post by:
Why is it when I have a DOCTYPE line in my HTML then "margin" and "padding" are ignored? This happens in both inline and stylesheet styles. It happens for both XHTML and HTML doctypes. It...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.