473,378 Members | 1,396 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,378 software developers and data experts.

Div in Table Cell extra space

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
{
HEIGHT: 100%;
BACKGROUND: #ffffff;
overflow: hidden;
BORDER-TOP: 1px solid;
BORDER-BOTTOM: 1px solid;
BORDER-LEFT: 2px solid;
BORDER-RIGHT: 2px solid;
WIDTH: 230px;
DISPLAY: inline;
position: static;
}
</style>

and here is the HTML fragment...

<table border="1" cellspacing="0" cellpadding="0"
style="width:250px;">
<tr height="10">
<td></td>
<td><img src="./images/top-lf-lb.gif" border="0" /></td>
<td width="100%" background="./images/top-repeat-strip-lb.gif"></td>
<td><img src="./images/top-rt-lb.gif" border="0" /></td>
</tr>
<tr>
<td></td>
<td colspan="3" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
<div id="treecontainer" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
</div>
</td>
</tr>
<tr height="10" id="r3">
<td width="3" valign="top">
</td>
<td><img src="./images/bottom-lf-lb.gif" border="0"></td>
<td width="100%" background="./images/bottom-repeat-strip-lb.gif">
<img src="./images/sp.gif" border="0"></td>
<td><img src="./images/bottom-rt-lb.gif" border="0"></td>
</tr>
</table>
Jul 20 '05 #1
1 7056
MB*********@yahoo.co.uk (MattB) wrote:
I have a table cell with a div in it. The div has a width of 300px.
Your CSS says 230px not 300px.
but when it is rendered it puts extra space into the table cell.
It's impossible to tell from the code you've posted below. Other
factors such as the doctype, the widths of the images used, and the
content within the div may all play a part. Post a URL.
<style>
Missing type attribute.
#treecontainer
{
HEIGHT: 100%;
BACKGROUND: #ffffff;
overflow: hidden;
BORDER-TOP: 1px solid;
BORDER-BOTTOM: 1px solid;
BORDER-LEFT: 2px solid;
BORDER-RIGHT: 2px solid;
WIDTH: 230px;
DISPLAY: inline;
You can't set widths on inline elments. So the width should be ignored
altogether.
position: static;
This is the default. Unless you have something like
div {position: relative;} elsewhere in your stylesheet this is totally
usless.
}
</style>

and here is the HTML fragment...

<table border="1" cellspacing="0" cellpadding="0"
style="width:250px;">
So the table should be 250px wide.
<tr height="10">
No such attribute as height for tr.
<td></td>
<td><img src="./images/top-lf-lb.gif" border="0" /></td>
Missing the required alt attribute here and on every image in your
sample.
<td width="100%" background="./images/top-repeat-strip-lb.gif"></td>
<td><img src="./images/top-rt-lb.gif" border="0" /></td>
</tr>
<tr>
<td></td>
<td colspan="3" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">
Wouldn't style="padding: 0;" be a lot less typing?
<div id="treecontainer" style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px;
PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-TOP: 0px">


Again, style="padding: 0;", and why not put this in the #treecontainer
style?

Make sure your code validates, then post a URL and we may be able to
find your problem.

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 20 '05 #2

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

Similar topics

23
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>...
7
by: John A. | last post by:
Hello all! I've got a big bunch of pages using tables for layout. Eventually I'll get them set up with more modernized code, but in the meantime I'd like to slip in a little quick holiday...
0
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>...
2
by: Marian Aldenhövel | last post by:
Hi, Short question: Is it possible to write a CSS-Style that formats <INPUT TYPE=TEXT>-Elements in Table-Cells in a way that they use all the horizontal space available? Long question: I...
2
by: Mark Goldin | last post by:
I have a table that is inside of a cell of another table. It seems that I cannot adjust the height of that cell. I have an extra space underneath of the internal table. ----------------------...
10
by: phil-news-nospam | last post by:
I have a table with 3 columns in 1 row. I want to increase the spacing _between_ the columns (gutter) _without_ increasing the spacing between those columns and the table itself. Is there a way...
11
by: rfox | last post by:
I've built a site using tables for layout, and it looks ok in everything but in IE where it places extra space around the graphics that contain a rollover script. (Please see...
5
by: Tom | last post by:
I am having a problem where an extra gap (whitespace, padding) appears in a table cell where I don't want it. The data fed in the table is via dynamic HTML, so the amount in the middle cell may...
1
by: meworkingman | last post by:
I'm a relative CSS newbie and I'm trying to do the following: I have a table that holds text that might span multiple cells. I want it to look something like this: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.