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

css table and border-margin-..

I've an image in a cell of a table.

I've this CSS:

..dbtable{
width: 600px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
border-collapse: collapse;
border: 1px solid #000000;
cursor: default;
}

..dbtable th{
font-weight: bold;
font-size: 13px;
background-color: #999999;
margin: 0px 0px 0px 0px;
padding:0px 0px 0px 0px;
/*border: 1px solid #000000;*/
}

..dbtable td{
border: 1px solid #000000;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}

I still have a left, bottom and right border around an image in a cell (but
strangely not at top).
How to avoid this ? I'd like no border between the image and the cell
border.

Also the text on the cell has top and bottom border. I'd like to set it to
0. How ?

Bob

PS: any link to manage tables in CSS would be interesting.
Jul 21 '05 #1
7 41712
"Bob Bedford" <be******@notforspammershotmail.com> wrote:
I've an image in a cell of a table.

I've this CSS:

.dbtable{
width: 600px;
padding: 0px 0px 0px 0px;
Is this class applied to a table? Tables don't have padding.
margin: 0px 0px 0px 0px;
margin: 0; is simpler.
border-collapse: collapse;
border: 1px solid #000000;
cursor: default;
What's the point of this?
}

.dbtable th{
font-weight: bold;
font-size: 13px;
Pixel sized text is a bad idea as Win IE users can't easily resize it
as needed.
background-color: #999999;
margin: 0px 0px 0px 0px;
padding:0px 0px 0px 0px;
/*border: 1px solid #000000;*/
}

.dbtable td{
border: 1px solid #000000;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}

I still have a left, bottom and right border around an image in a cell (but
strangely not at top).
Which styles are you applying to the image? The border of the image is
controlled by the styles applied to the image, not by the styles
applied to the table.
How to avoid this ? I'd like no border between the image and the cell
border.
td img {border: none;}
will remove the border from around all images inside table cells.
Though by default browsers only draw borders around images that are
links so you must have added the border yourself somewhere.
Also the text on the cell has top and bottom border. I'd like to set it to
0. How ?


border: none; on whichever element actually has the border. As very
few elements have borders by default it's most likely something that
you've added yourself. So look for any border styles in your CSS and
remove them.

Unless, you don't actually mean borders when you say borders.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #2
Steve Pugh <st***@pugh.net> wrote:
.dbtable{
width: 600px;
padding: 0px 0px 0px 0px;


Is this class applied to a table? Tables don't have padding.


They do, but as with the html cellpadding attribute it's not applied on
the element itself, but on the descendant cells. Note that it's worded
in a way that is easily misunderstood:

'padding-top', 'padding-right', 'padding-bottom', 'padding-left'
Value: <padding-width> | inherit
Initial: 0
Applies to: all elements except elements with table display types
other than table, inline-table, and table-cell

Also note that IE fails to get this right.

--
Spartanicus
Jul 21 '05 #3
Spartanicus <me@privacy.net> wrote:
Steve Pugh <st***@pugh.net> wrote:
.dbtable{
width: 600px;
padding: 0px 0px 0px 0px;
Is this class applied to a table? Tables don't have padding.


They do, but as with the html cellpadding attribute it's not applied on
the element itself, but on the descendant cells.


That makes sense. I'd never noticed it before, I suppose because I'd
never though of trying it. Setting the padding directly in the td or
th seems much more logical.
Note that it's worded in a way that is easily misunderstood:

Applies to: all elements except elements with table display types
other than table, inline-table, and table-cell


Gosh, that is a rather horrible sentence.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #4
>> border-collapse: collapse;
border: 1px solid #000000;
cursor: default;
What's the point of this?


Border-collapse does allow me to show the cell even there is no data in.
border 1px.... show a border (line) around the cell
cursor:default; show default cursor, as I've some cell where I show a hand.
}

.dbtable th{
font-weight: bold;
font-size: 13px;


Pixel sized text is a bad idea as Win IE users can't easily resize it
as needed.

I know but it's the only way to have full control on what I'm doing.
background-color: #999999;
margin: 0px 0px 0px 0px;
padding:0px 0px 0px 0px;
/*border: 1px solid #000000;*/
}

.dbtable td{
border: 1px solid #000000;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}

I still have a left, bottom and right border around an image in a cell
(but
strangely not at top).


Which styles are you applying to the image? The border of the image is
controlled by the styles applied to the image, not by the styles
applied to the table.
How to avoid this ? I'd like no border between the image and the cell
border.


td img {border: none;}
will remove the border from around all images inside table cells.
Though by default browsers only draw borders around images that are
links so you must have added the border yourself somewhere.
Also the text on the cell has top and bottom border. I'd like to set it to
0. How ?


border: none; on whichever element actually has the border. As very
few elements have borders by default it's most likely something that
you've added yourself. So look for any border styles in your CSS and
remove them.

Unless, you don't actually mean borders when you say borders.

Right, I'm talking about margins. I've no border (no outline), but I've
margins between the image and the cell's border. I've set this:

..dbtable td.img {border: none; margin:0px; }
img{border:none; margin:0px; padding:0px;}

But I still have margins on the left, bottom and right, but no on the top.

Bob
Jul 21 '05 #5
"Bob Bedford" <be******@notforspammershotmail.com> wrote:
Steve Pugh wrote:
"Bob Bedford" <be******@notforspammershotmail.com> wrote:
cursor: default;


What's the point of this?


cursor:default; show default cursor, as I've some cell where I show a hand.


But why do you need to set it to the default at the table level if you
are setting it to something else at the cell level?
font-size: 13px;


Pixel sized text is a bad idea as Win IE users can't easily resize it
as needed.

I know but it's the only way to have full control on what I'm doing.


You don't have full control. If you think you do you are fooling
yourself.
Unless, you don't actually mean borders when you say borders.


Right, I'm talking about margins. I've no border (no outline), but I've
margins between the image and the cell's border. I've set this:

.dbtable td.img {border: none; margin:0px; }
img{border:none; margin:0px; padding:0px;}

But I still have margins on the left, bottom and right, but no on the top.


1. Eliminate all white space.

2. Set the images in question to display: block; (as inline elements
images normally sit on the text baseline and hence there will be space
beneath them same as there is space between the text baseline and the
bottom of characters with descenders)

3. Post a URL if you still need help.

Steve
--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #6
Steve Pugh wrote:

2. Set the images in question to display: block; (as inline elements
images normally sit on the text baseline and hence there will be space
beneath them same as there is space between the text baseline and the
bottom of characters with descenders)


img {vertical-align: bottom} can give the same results

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #7
in comp.infosystems.www.authoring.stylesheets, kchayka wrote:
Steve Pugh wrote:

2. Set the images in question to display: block; (as inline elements
img {vertical-align: bottom} can give the same results


But don't, if line-height is bigger than image.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Jul 21 '05 #8

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

Similar topics

14
by: Carl Gilbert | last post by:
Hi I am currently writing a site that utilises tables. I have one page that links to a second page. The only problem is that when I link to the second page, the table loads up with a...
10
by: John | last post by:
I have a table with two rows. On the first row is a text box and in the second row is an image. I have set the table cellpadding to 0 and cellspacing to 0. The table is leaving extra spaces in the...
0
by: yurps | last post by:
Hello here is my html, if you click the missing image in the first column on the left, the div is shown, when clicked again the div disappears...but the bottom border disappears as well...Is there...
2
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...
16
by: karlman | last post by:
I am trying to create a web page that shows a calendar schedules. I am attempting to use table cells with fixed widths and different colors to display this. It seems that IE6 doesn't always...
11
by: Norman L. DeForest | last post by:
Am I misunderstanding the CSS specifications or is Firefox (version 1.0.6) (and Opera) doing the wrong thing? It appears that Firefox 1.0.6 includes the border in width calculations for tables...
7
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...
8
by: UJ | last post by:
I have a table with multiple cells and I want to draw a box around the entire table but not around the individual cells. How do I do that? TIA - Jeff.
1
by: Rako | last post by:
My problem is: I want to create an index to any of the available picture-groups. This index is a table of thumbs with a scrollbar. If you click on the thumb, you get the full picture displayed. ...
2
by: nino9stars | last post by:
Hello, I have just started messing with absolute positioning on webpages, and it definitely let's you do some creative things. Well, after much searching and help, I got the images I was using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...

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.