473,795 Members | 3,151 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Table cell border problem

Consider the following markup...

<html>
<head>
<style>
table.foo td { width: 100%%; border: 1px solid #000000; }
table.button td { width: 100%%; border: 5px outset; background-color: #c0c0c0; }
</style></head>
<body>
<table class="button">
<tr>
<td>Hello, world!</td>
</tr></table>
<table class="foo">
<tr>
<td>
<table class="button">
<tr>
<td>Hello, world!</td>
</tr></table></td></tr></table></body></html>

I want to create a style that makes <td>'s look exactly like IE6
renders the first <td>. I know that the .button style doesn't specify
the color, and that the initial value for that property is therefore
unknown. My problem is that I can't figure out how to specify a
border color and get it to look exactly like it looks without
specifying a color, and if I don't specify a color I can't use the
button in a nested table - the border gets screwed up. I've tried a
variety of grey border colors and none of them look the same. If
anyone has any ideas I'd be profoundly grateful!

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 21 '05 #1
4 6486
Christopher Benson-Manica <at***@nospam.c yberspace.org> spoke thus:
<style>
table.foo td { width: 100%%; border: 1px solid #000000; }
table.button td { width: 100%%; border: 5px outset; background-color: #c0c0c0; }
</style>


Hm, I tried using #dcdcdc for left/top solid borders and #808080 for
the right/bottom, and it looks pretty decent, although I'm still a
little peeved that IE has to be so finicky :) (I'm still open for
better suggestions!)

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 21 '05 #2
Christopher Benson-Manica <at***@nospam.c yberspace.org> wrote:
I want to create a style that makes <td>'s look exactly like IE6
renders the first <td>. I know that the .button style doesn't specify
the color, and that the initial value for that property is therefore
unknown. My problem is that I can't figure out how to specify a
border color and get it to look exactly like it looks without
specifying a color, and if I don't specify a color I can't use the
button in a nested table - the border gets screwed up. I've tried a
variety of grey border colors and none of them look the same.


The spec does not specify how a browser should display colours for inset
and outset borders, so different browsers give different results.

If you are not referring to different browsers, but to "html" table
borders looking slightly fancier than css outset borders (shaded) then
note that a border specified as an html attribute activates an outset
border on the table element *and* a 1px inset border on table cells.

--
Spartanicus
Jul 21 '05 #3
Spartanicus <me@privacy.net > spoke thus:
The spec does not specify how a browser should display colours for inset
and outset borders, so different browsers give different results.


That's unfortunate. I would have thought the spec would mention it,
in the interest of making it easier to obtain a consistent look and
feel.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 21 '05 #4
*Christopher Benson-Manica* <at***@nospam.c yberspace.org>:

table.foo td { width: 100%%;


One hundred whats?

--
"It is not worth an intelligent man's time to be in the majority.
By definition, there are already enough people to do that."

G. H. Hardy
Jul 21 '05 #5

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

Similar topics

23
18642
by: MattB | last post by:
Hello please help, I have a table cell with a div in it. The div has a width of 300px. but when it is rendered it puts extra space into the table cell. Here's the style <style> #treecontainer {
3
5912
by: N. Demos | last post by:
I have a single row table with fixed dimensioned cells nested inside a fixed dimensioned div, which has overflow: hidden. The div's dimensions are such that It should only display the first two table cells. This all renders correctly in MSIE 6.x, but doesn't in Firefox. In Firefox, the cell widths are reduced so that all the cells are displayed within the div frame. I've played around with this: commenting out css properties to see if...
2
8729
by: The_Original_MB | last post by:
I have a task to create tables dynamically, using the javascript DOM. The current method uses a 1px x 1px IFRAME to loop through some data generation stuff, and then call JS functions in the parent window to generate the tables. The basic idea is to add a table tag, with a thead and tbody, on the main parent page, that has display:none set. This then becomes display:block when there are rows to show. The rows themselves are added...
4
6153
by: Alex Meier | last post by:
I have the following problem: I need a simple, tabular layout in a webshop. - left column: navigation column with approx. 170px width - right column: content area the goal: the left column should contain a few "boxes" (these are HTML- tables) which should be all of the same width. So, I attributed the left column with 'width="170"' and assigned the attribute 'width="100%"' to all contained <table>s. This should
7
2628
by: Shawn B. | last post by:
Greetings, I am trying to create a table that has a scrolling body. The problem I'm experiencing is that if the columns in the "body" part of the table exceed the width of the "header" then they columns lose their alignment. Can anyone help me correct this?
0
1513
by: Thomas Scheiderich | last post by:
I have a table that has 3 image slices. The middle slice changes size based on size of browser window. This works great. My client wants the date to show over the image on the right. So what I did was cut off the top part of the image (which is just a solid color and I can handle by making the background-color of the cell this color). I then use a asp line to display the date, which also works. Here is the original table setup for...
7
4829
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want to be moved (while sorting) relative to their parent rows. The following is my complete html code...
5
13812
by: Romulo NF | last post by:
Greetings, I´m back here to show the new version of the drag & drop table columns (original script ). I´ve found some issues with the old script, specially when trying to use 2 tables with drag&drop on the same page (which was not possible). Now i´ve a new concept of the script, more object oriented. I´ve also commented the whole code so you guys can easier understand it engine. What exactly we need when trying to make a column drag &...
1
3427
by: jamesm6162 | last post by:
Hi I have the following XSL-FO document that I'm testing with the FOP processor. The table I put in, however, is completely stuck to the left side of the body-region, regardless of which margins or paddings I insert. How do I indent the whole table? This is extremely frustrating. Thanks <fo:flow flow-name="xsl-region-body"> <fo:block space-before="5mm" margin="5mm" border-style="groove" border-width="0mm" border-color="blue"...
1
3177
by: vp.softverm | last post by:
hi all . Am facing problem with the date picker. when i click on date picker in a popup window. the date table is opened in the middle of the pop up window. and it is unable to scroll with the pop up window .
0
9672
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
10438
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
10001
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
9042
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...
0
6780
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
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
2920
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.