473,805 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Borders on empty cell


http://www.acad.sunytccc.edu/instruc...at04/qz05_.htm

A table comes near the beginning of the page. I have the <td> of row
1 column 1 styled in line with border-top:none and border-left:none.
Yet the top and left borders are still present.

I've read the Tables section of the CSS2 spec several times, but
obviously there's something I'm not getting. Can someone help?

--
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 #1
7 5100
A table comes near the beginning of the page. I have the <td> of row
1 column 1 styled in line with border-top:none and border-left:none.
Yet the top and left borders are still present.


I'm shooting completely in the dark here, because I haven't done much with
CSS & Tables, and haven't looked at the source code, but maybe the border
it's showing top and left is the <table> border, not the <td> border? I
could (and probably am) wrong... but...

HTH.

P.
Jul 20 '05 #2
"The Plankmeister" <pl************ ******@hotmail. com> wrote:
A table comes near the beginning of the page. I have the <td> of
row 1 column 1 styled in line with border-top:none and
border-left:none. Yet the top and left borders are still present.


I'm shooting completely in the dark here, because I haven't done
much with CSS & Tables, and haven't looked at the source code, but
maybe the border it's showing top and left is the <table> border,
not the <td> border?


Yes. Setting the border attribute in HTML sets a border both for the
table as a whole and for individual cells.

It would be conceptually best to set borders either in HTML only or in
CSS only, but authors may wish to mix them in order to have some
fallback for non-CSS browsing situations, since data tables with no
borders are often awkward.

Suggestion: Use e.g. <table ... border="2"> in HTML and

table { border-collapse: collapse;
border: none; }
th, td { border: grove 2px; }

in CSS.

By the way, I wonder why Stan's style sheet centers the data cells.
Wouldn't right alignment be more suitable for numeric data?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #3
In article <Xn************ *************** **@193.229.0.31 > in
comp.infosystem s.www.authoring.stylesheets, Jukka K. Korpela
<jk******@cs.tu t.fi> wrote:
"The Plankmeister" <pl************ ******@hotmail. com> wrote:
I'm shooting completely in the dark here, because I haven't done
much with CSS & Tables, and haven't looked at the source code, but
maybe the border it's showing top and left is the <table> border,
not the <td> border?
Yes. Setting the border attribute in HTML sets a border both for the
table as a whole and for individual cells.


D'oh! That makes complete sense, as soon as it's explained. Now of
course I can't imagine why I didn't see that myself.
Suggestion: Use e.g. <table ... border="2"> in HTML and
table { border-collapse: collapse;
border: none; }
th, td { border: grove 2px; }
in CSS.
Thanks.
By the way, I wonder why Stan's style sheet centers the data cells.
Wouldn't right alignment be more suitable for numeric data?


<silly>
I didn't ask that question!!! How dare you make a suggestion that I
didn't specifically ask for? Some people are really arrogant!!! I
come here for help and you just pick holes in what I'm doing!!! I
had good reasons for centering those numbers, but you are too stupid
to understand them!!!
</silly>

Unlike some on this newsgroup, I am grateful for all suggestions. I
agree that right justification would make more sense. Thanks!

How good is browser support for text-align:"." ? That might be even
more appropriate than text-align:right. (These particular figures
are all whole numbers, but some other tables have mixed whole
numbers and decimals.)

By the way, the centering is done by this bit of styling:
table.internall ycentered td { text-align:center }
I couldn't think of a good functional (as opposed to presentational)
name for the class when I created it. But I think in fact all or
nearly all uses of "internallycent ered" are for tables of numbers.

The good news is that I can change _one_ place and that will fix
most or all of them. The bad news is that I would then have
table.internall ycentered td { text-align:right }
So I guess I'd better use a better class name, like "mostlynumbers" .
:-)

--
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 #4
Under Subject: Re: Borders on empty cell
Stan Brown <th************ @fastmail.fm> wrote:
How good is browser support for text-align:"." ?
Nonexistent, as far as I know. And this feature has been removed from
the CSS 2.1 draft, which is primarily an attempt to describe CSS
as currently implemented in modern browsers (and should therefore have
been named CSS 1.5 or something like that, but numbering of WWW related
specification and draft versions is traditionally illogical).
( http://www.w3.org/TR/CSS21/text.html#propdef-text-align )
That might be even
more appropriate than text-align:right. (These particular figures
are all whole numbers, but some other tables have mixed whole
numbers and decimals.)


Yes, text-align with a character or string value was basically meant
for such usage. But it was not implemented.

There's no good workaround I'm afraid. You could right pad all your
numbers so that all numbers in a column with decimal numbers have the
same amount of characters to the right of the decimal point, and right
align those cells. But there is no guarantee that this will align the
decimal points, since the characters to the right of it do not need to
have the same width. And all approaches to this have problems:
- using zeros works in practice (since fonts used by Web browsers
tend to have equal-width glyphs for digits) presentationall y but
often gives a wrong impression of precision
- using no-break spaces generally does not work (its width is different
from the width of numbers), and
- if you try to fix this by setting the font to monospace, the
appearance becomes rather ugly (even the decimal point will be of
the same width, unless you add extra markup to exclude it)
- using the U+2007 FIGURE SPACE character (defined, in Unicode, as
having the same width as "the digit width of fonts with fixed-width
digits") would fail badly in browsing situations where the browser
lacks Unicode support or the font lacks the character.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #5
In article <MP************ ************@ne ws.odyssey.net> in
comp.infosystem s.www.authoring.stylesheets, Stan Brown
<th************ @fastmail.fm> wrote:

http://www.acad.sunytccc.edu/instruc...at04/qz05_.htm

A table comes near the beginning of the page.


And following Jukka's suggestions I now have CSSized the borders --
and spacing, while I was about it.

Can I verify my (now slightly increased) understanding of
<http://www.w3.org/TR/REC-CSS2/tables.html>, to wit: in the
collapsing border model, there is no way to suppress borders of
empty cells automatically, nothing to correspond to empty-cells?

What I've done is to create a class "tlnotch" with border-left and
border-top set to none, and assigned that class to the upper-left
cell of that table. Is there a better way, or is that about it?

--
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 #6
In article <MP************ ************@ne ws.odyssey.net> , Stan Brown
wrote:
In article <MP************ ************@ne ws.odyssey.net> in
comp.infosystem s.www.authoring.stylesheets, Stan Brown
<th************ @fastmail.fm> wrote:

http://www.acad.sunytccc.edu/instruc...at04/qz05_.htm

A table comes near the beginning of the page.
Can I verify my (now slightly increased) understanding of
<http://www.w3.org/TR/REC-CSS2/tables.html>, to wit: in the
collapsing border model, there is no way to suppress borders of
empty cells automatically, nothing to correspond to empty-cells?
IIANM you are right. But you could emulate collapsing model using
separate modell ;-)
What I've done is to create a class "tlnotch" with border-left and
border-top set to none, and assigned that class to the upper-left
cell of that table. Is there a better way, or is that about it?


Other ways, at least:

tr:firstchild > td:firstchild {border:none} ?

To get it work on winIE whitout class I would try to add thead and then
use
thead td {border:none}

It would be inconvient to try selecting empty cells from other places
without classes, but upper left corner of table-row-group element.

--
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 #7
In article <MP************ ************@ne ws.cis.dfn.de> in
comp.infosystem s.www.authoring.stylesheets, Lauri Raittila
<la***@raittila .cjb.net> wrote:
In article <MP************ ************@ne ws.odyssey.net> , Stan Brown
wrote:
What I've done is to create a class "tlnotch" with border-left and
border-top set to none, and assigned that class to the upper-left
cell of that table. Is there a better way, or is that about it?
Other ways, at least:

[snip suggestion with 'firstchild']To get it work on winIE whitout class I would try to add thead and then
use
thead td {border:none}

It would be inconvient to try selecting empty cells from other places
without classes, but upper left corner of table-row-group element.


I rather like this approach. I ought to be using <thead> anyway, and
I think this form is more widely supported than firstchild.
Kiitos!(*)
(*) Did I get that right? If so, it's the only word of Finnish I
know.

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

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

Similar topics

2
3466
by: Hostile17 | last post by:
I've been trying to figure out a good way to make a CSS layout with nice-looking 1-pixel borders around the table cells. The only broadly compatible way to do this I know of is to have * the border of the table set to zero * the cellspacing of the table set to one * the background color set to black * the table cell background color set to white
5
2825
by: Analysis&Solutions | last post by:
Hi Folks: I've got a weird phenomenon going on with Internet Explorer on the Macintosh... The vertical cell borders are missing between the cells but appear above and below the cells! Here's the page and a screen shot a friend took for me because I use Windows. Shot: http://www.bikesummer.org/2003/local/rentals.jpg Page: http://www.bikesummer.org/2003/local/rentals.php
5
4616
by: Jeff North | last post by:
I'm trying to print a tables' cell/row but when a cell/row is split across 2 pages the cell bottom/top border doesn't print on either page. Like this: +--------+-----------------------------+ | | | page break | | | +--------+-----------------------------+
4
8939
by: Konrad Viltersten | last post by:
As it isnow i have to use a syntax for my tables as: <table class = "some" border> and/or <table class = "some" noborder> Now, what i'd like to do is to make that border-thingy appear/desappear using javascript. Is it solvable that way? I tried to rely on CSS but i didn't find any good info on this matter...
1
5849
by: Glen Vermeylen | last post by:
Hi, For a project at school we have to automate the assignment of seats in classrooms to students during the exams. The lady who previously did everything manually kept the layouts of the classrooms in an excel-document: 1 sheet per classroom, and she marked the cells which represent the seats with a border. The problem however is that she sometimes merged cells together to get a better layout.
0
1964
by: landon.chelf | last post by:
I'm working with a RichTextBox control and am loading the following rtf into it. {\rtf1\ansi\deff0 {\fonttbl {\f0\fswiss Arial;} } \deflang1033\plain\fs20 {\pard \trowd\cellx2500\cellx3000\cellx3500\cellx4000
10
45219
by: steve | last post by:
Hi All I would like to be able to change the cell borders on certain cells to none at runtime to make a group of cells appear to be merged I have tried the following in the cellformatting event..., to no avail Any ideas Regards
7
9702
by: steve | last post by:
Hi All I urgently need help on setting datagridview cell borders at runtime I found some code on the web from Programming Smart Client Data Applications with .NET 2.0 by Brian Noyes See below This is what I have been trying to achieve, but when I run it ALL the cell
17
5852
by: Grant Kelly | last post by:
I'm wondering if it's possible within HTML markup (or possibly CSS) to specify that an HTML table's headers should be placed 'over' the cell borders rather than 'within' the cells. For example (requires monospace font): Default: +--------------------+ | H1 H2 H3 | +--------------------+
0
10604
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...
0
10356
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10103
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9179
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
7644
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...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4316
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
3
3006
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.