473,398 Members | 2,380 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,398 software developers and data experts.

Nested Tables, defeating inheritance

I generate code to refer people to bookstores that generates a table
without internal borders. You can see an example on
http://mindprod.com/environment/kyoto.html

I can use this element nested in a table without borders just fine.
However if I use it in a bordered table as on
http://mindprod.com/jgloss/who.html

It becomes a mess. Every cell gets a border, overriding the normal
borderless styles.

So my question. How do I get the inner style to take precedence over
the outer style? Are they always both applied?

Is there some way to build a firewall around an element so that it
always renders the same no matter what the context?

In other words is there a way to turn off the cascading in cascading
style sheets?

I looked around on the web, and people seem to handle the problem by
abandoning tables altogether. This struck me as strange since the
markup was more verbose and more brittle. I'd only see you doing it
to create arbitrary forms, not simple grids.

--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #1
5 13129
Roedy Green <lo*****@mindprod.com.invalid> wrote:
How do I get the inner style to take precedence over
the outer style? Are they always both applied?
The question is vaguely formulated - concepts like "inner style" are
not CSS concepts.

What you _can_ do is to formulate your CSS rules so that they apply to
the desired elements only. For example, to make some rule apply only to
td elements in a table that is nested inside another table, you can
write
table table td { ... }

You _cannot_ formulate CSS rules so that they apply only to, say, cells
of a table that is _not_ nested inside another table. But you can
specify a rule that applies to all cells, and then _override_ it with a
rule that applies to some cells only. For example:
td { border: solid red thin; }
table table td { border: none; }
Is there some way to build a firewall around an element so that it
always renders the same no matter what the context?
No.
In other words is there a way to turn off the cascading in cascading
style sheets?


No.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #2
On Sun, 19 Jun 2005 05:09:54 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote or quoted :
What you _can_ do is to formulate your CSS rules so that they apply to
the desired elements only. For example, to make some rule apply only to
td elements in a table that is nested inside another table, you can
write
table table td { ... }


This is terrible. This means If I want my table to render a certain
way in all contexts I have to define a style for every possible
context to avoid the outer tables styles overriding mine. Ouch.
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #3
Roedy Green <lo*****@mindprod.com.invalid> wrote:
This is terrible. This means If I want my table to render a certain
way in all contexts I have to define a style for every possible
context to avoid the outer tables styles overriding mine. Ouch.


Welcome to the wonderful world of Cascading Style Sheets! They cascade
all over us.

You cannot even know _which_ style sheets will be applied to your
document. They could include a user style sheet with
td { border: solid red thin !important; }
and you have no weapon against that. Then again, if you can't help it,
you cannot be regarded as responsible for it.

To avoid unnecessary confusion: _inheritance_ (which you mention on the
Subject like) is something completely different.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 21 '05 #4
Tim
On Sun, 19 Jun 2005 06:00:54 GMT,
Roedy Green <lo*****@mindprod.com.invalid> posted:
This is terrible. This means If I want my table to render a certain
way in all contexts I have to define a style for every possible
context to avoid the outer tables styles overriding mine. Ouch.


How's that worse than messing with tables within tables trying to achieve
some particular affect? By the sound of things, you're making things hard
for yourself.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.
Jul 21 '05 #5
On Sun, 19 Jun 2005 06:27:06 +0000 (UTC), "Jukka K. Korpela"
<jk******@cs.tut.fi> wrote or quoted :
Welcome to the wonderful world of Cascading Style Sheets! They cascade
all over us.

You cannot even know _which_ style sheets will be applied to your
document. They could include a user style sheet with
td { border: solid red thin !important; }
and you have no weapon against that. Then again, if you can't help it,
you cannot be regarded as responsible for it.


Thanks for explaining the facts of life. I now have it working.

I explained my discoveries at http://mindprod.com/jgloss/css.html
--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/...s_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
Jul 21 '05 #6

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

Similar topics

0
by: Gurpreet Sachdeva | last post by:
Hi guys, Can anyone suggest some good tool for handling nested tables in a HTML page... BeautifulSoup is somehow not working with Nested Tables. Thanks and Regards, Garry
1
by: siu02rk | last post by:
Hello All, Can anyone please explain to me why you would need to use Nested tables and give an example. Also can you show the SQL to view the table and the nested table and explain the logic of...
1
by: Joseph Ferris | last post by:
Hello, I am having an issue with page breaking that I hope someone will be able to help me with. Still a relative "newbie", and I thought this might be a good place to find some help. I have a...
1
by: boris bass | last post by:
Below is linenumbered as well as original code -------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type...
1
by: Eric Bohlman | last post by:
What's the correct technique for nesting a bordered table inside of cell of another bordered table without getting a double-thickness border around the nested table? This is assuming the...
2
by: Pieter Van Waeyenberge | last post by:
hello the very simple code below works on all browsers except for (most recent) safari why doesnt the inner table expand in height? ive read and tested many a thing! <html> <head>...
1
by: le_sloth | last post by:
Hi I'm generating a series of reports from an application that will be published on a client's intranet. The idea is that each of these reports is arranged into major product groups,...
5
by: Giggle Girl | last post by:
Is there a way to prevent properties (specifically, height and background color) from being "inherited" by nested tables? Something similar (but sort of opposite to) !important, like...
1
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have problems loading XML data into SQL Server. What is the best way to go ? I am new in using XML documents. I have tried to do it with "Integration Services" and also with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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...
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...
0
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,...
0
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...

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.