some questions on CSS and Javascript
ok. this has gone off to something else so i tried to delete the thread and restart it to get back on track. deleting it was not allowed
ok. this has gone off to something else so i tried to delete the thread and restart it to get back on track. deleting it was not allowed
fiesty_01 posted this at 21:25 — 8th October 2003.
He has: 173 posts
Joined: Nov 2002
In response to your first message only, I was just wondering if you had tried the following format (which doesn't have to be in the CSS) for the tables you want centered (?), rather than the HTML and tags:
As for the borders, for me, I'm finding it much easier to use the following format, using bgcolors to form what appear to be borders (but are actually just the bgcolors), and this has removed the need for a "border" tag completely:
(Text Goes Here)
(Text Goes Here)
The above would be a centered, 2-column (or td) table, one at 20% width, the other at 80% width, both with centered text, with a white (#ffffff) background color in each and what would appear to be a blue (#0000ff) border which would appear to go all around the table AND the td's (columns).
Sorry, but the javascript part would be better tackled by someone else.
fiesty_01 posted this at 23:09 — 8th October 2003.
He has: 173 posts
Joined: Nov 2002
Is the align="center" declaration deprecated?
As for the bgcolor, if I'm not mistaken, I think it may just be something like this in the CSS:
td {
background-color: #??????;
}
I'm not finding ANY way to center a table on a page with CSS, at least not without centering everything else (text, etc.) . . . unless there's something I haven't seen yet such as this:
table {box-align: center;}
Haven't seen any "box-align" things out there, though.
Suzanne posted this at 23:23 — 8th October 2003.
She has: 5,507 posts
Joined: Feb 2000
boy, I get to repeat myself a lot!
to align a block level element, you need to use margins. for inline level elements, you use text-align. as usual, IE has its own rules, which may require using one of the many many hacks out there to hide instructions from IE.
margin-left: auto;
margin-right: auto;
That centers boxes within their containers.
Suzanne posted this at 23:24 — 8th October 2003.
She has: 5,507 posts
Joined: Feb 2000
re: borders
border-collapse
Also, see the link I posted somewhere in this huge amount of text to a post at webstandards.org that links to four or five pages on how to do tables (and borders) in CSS.
Suzanne posted this at 23:53 — 8th October 2003.
She has: 5,507 posts
Joined: Feb 2000
Ah, here it is again...
http://www.webstandards.org/buzz/archive/2003_09.html#a000203
And a quick spin around Google for "css+tables" gets me this:
http://www.htmlcenter.com/tutorials/tutorials.cfm/61/CSS/
Suzanne posted this at 23:57 — 8th October 2003.
She has: 5,507 posts
Joined: Feb 2000
and this:
http://www.macedition.net/cb/resources/tableCSStest.html
Suzanne posted this at 06:21 — 9th October 2003.
She has: 5,507 posts
Joined: Feb 2000
oh for pete's sake!
fiesty_01 left you two links that do it in your other thread. you don't use BOTH text-align and margins unless you want it all centered. margins for block level, text-align for inline!
for the borders, learn to set ids.
table#thisone {
border-collapse: collapse;
}
table#thisone td {
border-collapse: collapse;
}
As for your JavaScript, there is so much of it I can't even grasp it.
How about trying more specific questions? And less code dumping. A link to working pages works VERY well. PLEASE do not link between threads, it's just confusing and clearly you're not reading the responses very well because this question has been answered repeatedly.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.