473,763 Members | 3,901 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

table row - border on the bottom

I would like my table header to have a border on the bottom. What I
have written works in Mozilla (1.7.12) but not IE (6).

I have included the snippet of html and the snippets of CSS. Any
suggestions would be appreciated. Thank you.

http://www1.esc.edu/personalstu/fhartnet/books.html
<tr class="lightblu e">
<th>Title</th>
<th>Author</th>
<th>Synopsis</th>
</tr>

table {border-collapse: collapse;
table-layout: auto;
width: auto;}

tr.lightblue{
background-color: #CCFFFF;
color: black;
font-weight: bold;
font-family: sans-serif, serif;
font-size: 18px;
caption-side: top;
padding: 5px;
border-bottom: 5px solid black;
}

Jan 16 '06 #1
4 81858
Els
eomer wrote:
I would like my table header to have a border on the bottom. What I
have written works in Mozilla (1.7.12) but not IE (6). [snip] <tr class="lightblu e">
<th>Title</th>
<th>Author</th>
<th>Synopsis</th>
</tr>

table {border-collapse: collapse;
table-layout: auto;
width: auto;}

tr.lightblue{ [snip] border-bottom: 5px solid black;
}


You need to put the border on the bottom of the <th>s.
tr.lightblue th{
border-bottom:5px solid black;
}

(not because of that being the right way according to the specs, but
because IE won't do it otherwise ;-) )

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jan 16 '06 #2
Thank you so much!
I just love these differences between the browsers.

Jan 16 '06 #3
eomer wrote :
I would like my table header to have a border on the bottom.
Then
<table frame="below" ...>
will be sufficient

What I have written works in Mozilla (1.7.12) but not IE (6).

I have included the snippet of html and the snippets of CSS. Any
suggestions would be appreciated. Thank you.

http://www1.esc.edu/personalstu/fhartnet/books.html
<tr class="lightblu e">
<th>Title</th>
<th>Author</th>
<th>Synopsis</th>
</tr>

table {border-collapse: collapse;
table-layout: auto;
The initial and default value of table-layout is auto. So, you do not
need to define this property value. I must point out that defining
table-layout: auto;
is not making much sense. The best/better setting is table-layout: fixed
in a very wide majority of cases when a table displays tabular data.
width: auto;}
Same thing here. width initial and default value is auto. There is no
need to set it to auto. Again here too, if you want to have a table
which is scalable and proportional, then using a %tage is appropriate too.

tr.lightblue{
background-color: #CCFFFF;
color: black;
color is inherited and is an inheritable property. Chances are you do
not need to define this.
font-weight: bold;
font-family: sans-serif, serif;
font-size: 18px;
caption-side: top;
Caption-side is wrongly used here. caption-side should be used on the
table element or the caption element. Note again that caption-side
initial and default value is top.
padding: 5px;
border-bottom: 5px solid black;
}


I checked your markup code and noticed many incoherences:

<table class="books" summary="book recommendations " width="80%">
<caption id="recommended reading">Book Recommendations </caption>
<colgroup width="20%"></colgroup>
<colgroup width="20%"></colgroup>
<colgroup width="40%"></colgroup>

Your markup code is being redefined by the CSS; so it's illogical,
counter-productive.

If the table width should be set by the content, then you should not set
any value for the width attribute value.

The colgroups width should total 100%, otherwise this does not make any
sense. If you have n colgroups, then the total value of each of these
colgroup's width should equal to 100%.
td.stayleft{
text-align: left;
vertical-align: middle;
}

Here, the default horizontal alignment value in all browsers for <td> is
left. What you do is unneeded and unnecessary. Same thing with
vertical-align: the initial and default value of vertical alignment of
table cell in all browsers is middle.

"left: Left-flush data/Left-justify text. This is the default value for
table data."

"middle: Cell data is centered vertically within the cell. This is the
default value."

HTML 4.01 spec, Section 11. Tables
11.3.2 Horizontal and vertical alignment
http://www.w3.org/TR/html401/struct/....html#h-11.3.2

So, here you have 14 occurences of class="stayleft " which is unneeded
and unnecessary.
Overall, your CSS file is over-constraining, over-declaring and
over-defining. There is no reason to have so many classes, CSS rules in
your

http://www1.esc.edu/personalstu/fhartnet/newstyle.css

You should be using the power of inheritance and using/relying on
default/initial value instead of redefining all the time the properties
which are already inherited.

- Writing Good and Efficient CSS:
http://developer.mozilla.org/en/docs..._Efficient_CSS
- Writing perfect style sheets:
http://www.richinstyle.com/masterclass/perfection.html (except for tip 4
where it is written: "each and every block element must have
declarations for margin, padding and line height"), I recommend this
tutorial

My own interactive demo:
Dynamic table formatting for DOM 1 browsers
http://www.gtalbot.org/DHTMLSection/...ormatting.html

Gérard
--
remove blah to email me
Jan 16 '06 #4
eomer a écrit :
I would like my table header to have a border on the bottom. What I
have written works in Mozilla (1.7.12) but not IE (6).

I have included the snippet of html and the snippets of CSS. Any
suggestions would be appreciated. Thank you.

http://www1.esc.edu/personalstu/fhartnet/books.html
<tr class="lightblu e">
For best maintenance purpose, you should define class name by the
purpose or functionality of a group of element, not by its style and
presentational purpose. In my opinion, your webpage would most likely
not be needing any class declaration if your markup semantic was better.

E.g.:

Book Recommendations would be the caption and
Title Author Synopsis
would be the table header (<thead>).

<th>Title</th>
<th>Author</th>
<th>Synopsis</th>
</tr>

table {border-collapse: collapse;
table-layout: auto;

'table-layout'
Initial: auto
http://www.w3.org/TR/CSS21/tables.ht...f-table-layout
width: auto;}

'width'
Initial: auto
http://www.w3.org/TR/CSS21/visudet.html#propdef-width

tr.lightblue{
background-color: #CCFFFF;
color: black;
font-weight: bold;
font-family: sans-serif, serif;

font-family should be given only and only one generic font-family.

In any case, you do not need to define a font-family if such font is
inherited from your body node. Again, you may be defining unneedlessly
and unnecessarly a CSS declaration here. And if you need to define a
particular font-family for your table, then you do not need to redefine
it for each table row: that is why I say you have over-declared and
over-defined your CSS file.

font-size: 18px;
You should not use absolute value for font-size. What you do will make
your table data unresizable, non-scalable in visual browsers like MSIE 6:

"# Do not specify the font-size in pt, or other absolute length units.
They render inconsistently across platforms and can't be resized by the
User Agent (e.g browser).
# Use relative length units such as percent or (better) em, or, even
better, set a base font-size for the document (...)"

W3C Quality Assurance tip for Webmasters:
Care with Font-size
Good usage of CSS's font properties; Recommended practices
http://www.w3.org/QA/Tips/font-size#goodpractice
caption-side: top;

'caption-side'
Initial: top
Applies to: 'table-caption' elements
http://www.w3.org/TR/CSS21/tables.ht...f-caption-side
Note that caption-side applies to table-caption elements, not table rows.
padding: 5px;
border-bottom: 5px solid black;
}


Gérard
--
remove blah to email me
Jan 16 '06 #5

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

Similar topics

9
43525
by: Harry | last post by:
Whats wrong with this? top.document.frmMain.tabMain.border = "1"; thanks
1
29467
by: Mike | last post by:
Is there a way to have a border around the outside of a table, but not around each cell in the table?
3
2152
by: Peter Foti | last post by:
I have a table that contains 3 rows, and 2 columns. I would like a border that surrounds the entire table, and then a border separating the left and right columns, but no border separating rows. I was able to do this, but I wasn't sure if this is the best approach (or if there is a cleaner approach). I apologize in advance for posting code (but it's a small amount, so I hope you'll forgive me). Here's the styles I used: ...
6
15933
by: Mr. Clean | last post by:
Apparently Mozilla/Firefox doesn't support the bordercolor attribute of the table tag. Here's what I do that works in IE: <table border="1" cellpadding="2" cellspacing="0" width="380" bordercolor="#CB0017"> Now, if I add this to my CSS:
1
4569
by: Baldy | last post by:
Hi, I put a border color bottom on my links, just to make it a different color underline, but now the border bottom is also showing up under my images. HELP? I did do an img {border-bottom:0px solid #000000}, but that does not help..JHELP? Here's the page: wholives.com/tools.freestuff.html
11
11360
by: Michael Mayo | last post by:
I have a simple html page that contains an image in a single table cell, surrounded by a border: <http://www.softrains.com/lc/test.html>. I would like to eliminate the space between the table border and the table contents. I have tried setting margin: 0 in CSS everywhere, as well as cellmargin/cellpadding in HTML. What is the best way to eliminate the extra space between a table border and its contents? Thanks,
2
18495
by: elkeseltza | last post by:
Hi I am supernew at all this webstuff and am learning as I go. One of the major problems I have already encountered on numerous occasions is that IE and FF don't display the same way! Latest problem is the outside table border. Did not use Css as I have not worked my way up to those yet :-( Used the following in the ouside table tag (not sure how to indicate width) frame="border" bordercolor="#999999" In FF this displays...
2
9082
by: test2000 | last post by:
Hello in my CSS section #post-footer I added the line border-bottom: 1px solid #d0d0d0; but the bottom line doesn't show up up. I think the code is correct because the exactly same code works fine a another CSS section (eg #footer).
1
1597
by: micross | last post by:
hi how to add the border and edit ,delete button ,plz helme . <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server">
1
2467
by: micross | last post by:
How add the Edit button and table border. <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Dynamic Table</title> <script language="javascript" type="text/javascript">
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9998
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...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
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
8822
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
7366
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...
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
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.