473,394 Members | 1,944 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,394 software developers and data experts.

table style question



I know that if I want all my table entries to be of height 25, I can put
this in my style file:

table tr td {height:25}
But what if I want the above to only apply to a particular table ? How
can I name the above style and use it selectively in only certain
tables?

And what do I put in the table to invoke it ?

I would imagine it's something like this :

.myTableStyle {
table tr td {height:25}
}

and then

<table class=myTableStyle>

but I doubt it's that simple...

/Eric

Jul 20 '05 #1
13 2586
Eric Osman wrote:
I would imagine it's something like this :

.myTableStyle {
table tr td {height:25}
}

and then

<table class=myTableStyle>

but I doubt it's that simple...


It is nearly that simple. How about:

table.MyTableStyle, td.MyTableStyle
{
height:25px;
}

<table class=MyTableStyle>

AFAIK you don't have to define a style for tr. And you do have to specify
25*something*.
--

Groet,
Barbara

http://home.wanadoo.nl/b.de.zoete/index.html
Jul 20 '05 #2
In article <3F**************@rcn.com>, Eric Osman wrote:
I know that if I want all my table entries to be of height 25, I can put
this in my style file:

table tr td {height:25} 25cm? 25in? 25horses? You need unit in CSS. Exeption is zero, it don't
need unit.
But what if I want the above to only apply to a particular table? I would imagine it's something like this :

.myTableStyle {
table tr td {height:25}
}

but I doubt it's that simple...


No, it is much simpler:
..myTableStyle table tr td {height:2em;}

And

..myTableStyle td {height:2em;}

is about same.

--
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 #3
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de Zoete
wrote:
table.MyTableStyle, td.MyTableStyle
{
height:25px;
}

<table class=MyTableStyle>


That don't work. It makes the table 25px height, and all td's with class
MyTableStyle. Not td's inside table that has class MyTableStyle

Both of you, learn this:
http://www.w3.org/TR/CSS2/selector.html
--
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 <MP************************@news.cis.dfn.de>, Lauri Raittila
wrote:
No, it is much simpler:
.myTableStyle table tr td {height:2em;}
Should be table.myTableStyle
And

.myTableStyle td {height:2em;}


This was correct.

--
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
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de Zoete
wrote:
Lauri Raittila wrote:
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de
Zoete wrote:
table.MyTableStyle, td.MyTableStyle
{
height:25px;
}

<table class=MyTableStyle>
That don't work. It makes the table 25px height, and all td's with
class MyTableStyle. Not td's inside table that has class MyTableStyle

Both of you, learn this:
http://www.w3.org/TR/CSS2/selector.html


Thank you for correcting that typo.


You accidentally typed table.MyTableStyle, td.MyTableStyle
when you meaned table.MyTableStyle td ?

It was no typo, it was error in thinking. Like mine on my first post...
And for your kind remark ;-)
When you do make mistake, people do think you don't know much. Maybe it
shouldn't be thatway. I just cursed it yeasterday. Or maybe I just
shouldn't make mistakes.
http://home.wanadoo.nl/b.de.zoete/index.html


BTW, have you looked you page with new Opera? It seems totally broken.

--
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 #6

"Lauri Raittila" <la***@raittila.cjb.net> wrote in message
news:MP************************@news.cis.dfn.de...
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de Zoete

When you do make mistake, people do think you don't know much. Maybe it
shouldn't be thatway. I just cursed it yeasterday. Or maybe I just
shouldn't make mistakes.
http://home.wanadoo.nl/b.de.zoete/index.html


BTW, have you looked you page with new Opera? It seems totally broken.

The dtd puts it in quirk mode!

David
Jul 20 '05 #7
Lauri Raittila wrote:
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de
Zoete wrote:
Lauri Raittila wrote:
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de
Zoete wrote:
table.MyTableStyle, td.MyTableStyle
{
height:25px;
}

<table class=MyTableStyle>

That don't work. It makes the table 25px height, and all td's with
class MyTableStyle. Not td's inside table that has class
MyTableStyle

Both of you, learn this:
http://www.w3.org/TR/CSS2/selector.html
Thank you for correcting that typo.


You accidentally typed table.MyTableStyle, td.MyTableStyle
when you meaned table.MyTableStyle td ?


No, not this part. Here I meant what I typed.

But the <table class="..> part. Should have read <td class="..>. Fingers
faster than mind.
It was no typo, it was error in thinking. Like mine on my first
post...

When you do make mistake, people do think you don't know much.
I don't, actually, know that much. My page currently running is the first
since like 12-13 years or so. Sometimes I like to think I do now something
:-) and than sometimes go wrong. Like with the table.MyTableStyle td {
[...] }.
Maybe
it shouldn't be thatway. I just cursed it yeasterday. Or maybe I just
shouldn't make mistakes.


Same here.
http://home.wanadoo.nl/b.de.zoete/index.html


BTW, have you looked you page with new Opera? It seems totally broken.


:-? I've tested it in IE6, NS7 and OP7 and had a newsgroup full of critics
look at it. Nobody reported any problems with the end-product (except for
older browsers, not supporting CSS2; not fixed yet). Just looked at it in
OP7 (running Win XP Pro). Looks fine to me. Screenshot?

Know about Quirks-mode. Just don't feel like correcting it all right now.
Maybe in a more rainy season.

--
Groet,
Barbara

http://home.wanadoo.nl/b.de.zoete/html/vliegen.html
Jul 20 '05 #8

Thanks for all the responses.

Yes, I do use a book for css. It's "HTML & XHTML" by Chuck Musciano and
Bill Kennedy published by O'Reilly.

However, the book doesn't explain all the different kinds of css I can
think of needing, and the css syntax doesn't always have enough rhyme or
reason that new ideas can be always extrapolated.

I didn't leave out the units on purpose. Sorry for that inadvertant
subterfuge.

Also, note that my goal is to not have to put something again and again
on each td. hence having to say <td class=...> is no more useful to me
than saying <td height=...> .

Anyway, thanks to all your responses, I'm now using the following solution.

In my css file:

.headingsTable td {height:2em}

And in my html, in the tables in which I want that particular spacing:

<table class=headingsTable ...>
/Eric

Jul 20 '05 #9
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de Zoete
wrote:
BTW, have you looked you page with new Opera? It seems totally broken.


:-? I've tested it in IE6, NS7 and OP7 and had a newsgroup full of critics
look at it. Nobody reported any problems with the end-product (except for
older browsers, not supporting CSS2; not fixed yet). Just looked at it in
OP7 (running Win XP Pro). Looks fine to me. Screenshot?


I was mistaken it is not totally broken, but uses tables. I don't like
widths on tables, which seems to break your site:
http://www.student.oulu.fi/~laurirai...creencap10.png
Whitout userstyle is looks as intended.

Anyway, someone might understand why I don't like table layouts.
(_usually_ that userstyle makes table layout look better, this is only
third exeption in 4 months I have seen.)
--
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 #10
Lauri Raittila wrote:
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de
Zoete wrote:
BTW, have you looked you page with new Opera? It seems totally
broken.
:-? I've tested it in IE6, NS7 and OP7 and had a newsgroup full of
critics look at it. Nobody reported any problems with the
end-product (except for older browsers, not supporting CSS2; not
fixed yet). Just looked at it in OP7 (running Win XP Pro). Looks
fine to me. Screenshot?


I was mistaken it is not totally broken, but uses tables. I don't like
widths on tables, which seems to break your site:
http://www.student.oulu.fi/~laurirai...creencap10.png


Thank you for this! Ugly mess it is. Hope not too many people use Opera with
userstyle ;-)
Whitout userstyle is looks as intended.

Anyway, someone might understand why I don't like table layouts.
(_usually_ that userstyle makes table layout look better, this is only
third exeption in 4 months I have seen.)

Don't know if that's good or bad :-)

I'm still learning how to use divs to put elements in the right place on the
page. In this case (with both a vertical menu to the left of the text, which
is in divs, and a horizontal one 'embedded' in de body of the text) I
couldn't get it right. So eventually I gave up and put the horizontal menu
in a table.

A quick thought. Would it work to put the elements of the horizontal menu in
a 'container' div that has text-align:center (maybe specify a min-width) and
then just put the rest of the elements inside the container div as is? Or am
I missing out on something essential?

--
Groet,
Barbara

http://home.wanadoo.nl/b.de.zoete/index.html
Jul 20 '05 #11
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de Zoete
wrote:
I was mistaken it is not totally broken, but uses tables. I don't like
widths on tables, which seems to break your site:
http://www.student.oulu.fi/~laurirai...creencap10.png
Thank you for this! Ugly mess it is. Hope not too many people use Opera with
userstyle ;-)


It's not Opera's it's my own. Available for public though so someone else
may use it:
http://www.student.oulu.fi/~laurirai...styles/Oma.css
A quick thought. Would it work to put the elements of the horizontal menu in
a 'container' div that has text-align:center (maybe specify a min-width) and
then just put the rest of the elements inside the container div as is? Or am
I missing out on something essential?
I don't know what you are after, but IMHO it would be better than current
way.


-- Groet,
Barbara

http://home.wanadoo.nl/b.de.zoete/index.html


--
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 #12
>Lauri Raittila wrote:
In article <bf************@ID-52872.news.uni-berlin.de>, Barbara de
Zoete wrote:
A quick thought. Would it work to put the elements of the horizontal
menu in a 'container' div that has text-align:center (maybe specify
a min-width) and then just put the rest of the elements inside the
container div as is? Or am I missing out on something essential?


I don't know what you are after, but IMHO it would be better than
current way.


Hmm, tried a lot of different things now. None of them seem to do exactly
what I want (except for in IE6, but what else is new). Either NS7 or OP7
makes a mess of anything I try.
I think I keep the pages as they are right now. Thanks for your input,
though. Keeps me aware that *never* all gets displayed to everyone as I
intended it to and sometimes the result doesn't even come close.

Thank you,

--

Groet,
Barbara

http://home.wanadoo.nl/b.de.zoete/index.html
Jul 20 '05 #13

I'm trying to make there be 2 inches margin before each row. The
"top-margin" style didn't work at all.

Here we see me trying "padding-top" and it is producing way more than 2
inches. Why ????

Actually, I really would rather not have to specify the class on each
row. I'd rather somehow specify it once when I define the table. How
can I do that ?

/Eric

<html><head><style>
..tc {padding-top:2in}
</style></head>
<body>
<table>
<tr><td class=tc>first row
<tr><td class=tc>second row
<tr><td class=tc>third row
</table>
</html>

Jul 20 '05 #14

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

Similar topics

61
by: Toby Austin | last post by:
I'm trying to replace <table>s with <div>s as much as possible. However, I can't figure out how to do the following… <table> <tr> <td valign="top" width="100%">some data that will...
20
by: WindAndWaves | last post by:
Hi Gurus I was wondering if you can send me in the right direction: I have a table with about 300 rows. I want to make all of them invisible and when a user enters a code in a form then make...
0
by: javaguy | last post by:
I have a table I hide show/hide through a pair of divs. The show/hide part works fine in both Mozilla and MSIE. When switching between the hide and show versions the Mozilla browser keeps them in...
1
by: chris | last post by:
I've used JavaScript DOM scripting to create a table element and alter its opacity. Bizarrely, the contents of the table appear to vanish when the opacity changes. One important note is that I...
6
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID ...
2
by: Junior | last post by:
Hi All, I haven't got a response for this question lately and i really need to get this done ASAP. I have a .aspx page that has table two column four rows on it. 1. How do i use codebehind C#...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
by: cbradio | last post by:
Hi, I am having trouble developing a form in a restricted environment. My sample code is found below my message (sorry I don't have a URL). Basically, without a doctype, the form displays properly...
3
by: PYG | last post by:
Hi everybody I have a simple question : If i use this code : <body style="font-size:24px;color:blue;"> Text in body <table> <tr><td> Text in table
3
dmjpro
by: dmjpro | last post by:
I think iText commonly used to create or manipulate PDF document in Java. So finally i decided to throw a question over here. For two days i am struggling. I encountered two types of table .....
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.