473,463 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

White space problem (table)

Hi,

I'm having trouble with some white space that's appearing in my table.
I can't seem to spot the problem, it'd be great if someone could help.
The HTML code (ignore the PHP, it shouldn't be an issue) I'm using to
create the table is...

<table align="center" cellpadding="5" width="650" border="1">
<tr>
<td width="100">
<img src="<? echo $imgPath; ?>" width="100" height="130"/>
</td>
<td valign="top">
Title: <? echo $title; ?>
<br />Year: <? echo $year; ?>
<br />Certification: <? echo $cert; ?>
</td>
</tr>
<tr>
<td colspan="2"><br /><br />Sypnosis: <p /><? echo $syp; ?></td>
</tr>
<tr>
<td colspan="2">
<br /><br /><a href="addtobasket.php?movID=<? echo $movID;
?>&movTitle=<? echo urlencode($title); ?>">Add to basket</a>
<br /><br /><a href="javascript: history.go(-1)">Back</a>
</td>
</tr>
</table>
I've taken a screenshot of the output from this code -
http://img.photobucket.com/albums/v2...tmlproblem.jpg

I'm unsure as to what is causing the whitespace in the top left cell. I
need the text in the top right cell to be sitting up against the image.
I do have a table entry in my CSS file but the only attributes it
specifies are font-size, font-family and color.

Thanks.

Apr 3 '06 #1
8 3457
ch**********@googlemail.com wrote:
The HTML code (ignore the PHP, it shouldn't be an issue) I'm using to
create the table is...
Why don't you post the URL so that we could see the actual problem?
I've taken a screenshot of the output from this code -


Why don't you post the URL so that we could see the actual problem?

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Apr 3 '06 #2
ch**********@googlemail.com wrote:
I'm having trouble with some white space that's appearing in my table.
Then don't use a table.
I can't seem to spot the problem,


How do you expect us to do any better - you didn't even post the URL.

Apr 3 '06 #3
I posted a screenshot and the code. I can give you the URL but it wont
work because the server doesn't allow public access.

Apr 3 '06 #4
http://much.cs.nott.ac.uk/~cxi03u/cg....php?movID=101

.... if it makes you feel better.

Apr 3 '06 #5
Once upon a time *c***********@googlemail.com* wrote:
I posted a screenshot and the code. I can give you the URL but it
wont work because the server doesn't allow public access.


Who are you talking to?

How to quote: http://www.netmeister.org/news/learn2quote.html#toc2
From Google: http://www.safalra.com/special/googlegroupsreply/

--
/Arne

- "I travel cross the country and talked to the most competent persons,
and I can assure you that the computer is a fashion craze that will not
stand the whole year". (Editor for business literature, Prentice Hall, 1957)
Apr 3 '06 #6
IE is ignoring your 100px table cell width once you added the second TR
with a sufficient amount of text into the col-spanning TD. Try it
again with a synopsis of a few characters and you'll see what I mean.

Since you're using a table-based layout here, you might consider using
a table-within-a-table approach to avoid the browser guessing at the
best split point, e.g.

<table>
<tr>
<td>
<table>
<tr>
<td width=100>img</td>
<td>title year cert</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>synopsis</td>
</tr>
<tr>
<td>links</td>
</tr>
</table>

Style as necessary. Yucky,
Yucky Korpulent

Apr 3 '06 #7
To further the education of mankind, ci****@yahoo.com declaimed:
Since you're using a table-based layout here, you might consider using
a table-within-a-table approach to avoid the browser guessing at the
best split point, e.g.


Or how about just floating the image left?

--
Neredbojias
Apprentice Learner
Apr 3 '06 #8
ch**********@googlemail.com wrote :
Hi,

I'm having trouble with some white space that's appearing in my table.
I can't seem to spot the problem, it'd be great if someone could help.
The HTML code (ignore the PHP, it shouldn't be an issue) I'm using to
create the table is...

<table align="center" cellpadding="5" width="650" border="1">
<tr>
<td width="100">
<img src="<? echo $imgPath; ?>" width="100" height="130"/>

Table cell = left cell padding + image width + rigth cell padding
100px = 5px + 100px + 5px

That is the equation your code is putting to/asking rendering browsers.
Your problem is that your code over-constrains the table and table
cells: this is a very very common problem with people using or abusing
table.

Here, I'd say that your table data is not tabular data. You use table
for laying out the info when the info is not tabular.

</td>
<td valign="top">
Title: <? echo $title; ?>
<br />Year: <? echo $year; ?>
<br />Certification: <? echo $cert; ?>
</td>
</tr>
<tr>
<td colspan="2"><br /><br />Sypnosis: <p /><? echo $syp; ?></td>
</tr>
<tr>
<td colspan="2">
<br /><br /><a href="addtobasket.php?movID=<? echo $movID;
?>&movTitle=<? echo urlencode($title); ?>">Add to basket</a>
<br /><br /><a href="javascript: history.go(-1)">Back</a>
Do not use "javascript:" pseudo-protocol in a link. The fault with your
code is more grave because you are trying to duplicate the normal
functionality of browser's back button with javascript.

This form of code
<a href="javascript: ...">some text</a>
should only and only be used for bookmarklet.

</td>
</tr>
</table>
I've taken a screenshot of the output from this code -
http://img.photobucket.com/albums/v2...tmlproblem.jpg

I'm unsure as to what is causing the whitespace in the top left cell.


The default vertical positioning of data in a table cell <td> in all
browsers is middle. Also, your code requested a padding of 5px all
around the table cell.

Use CSS. Not table for positioning non-tabular data.

Table-based webpage design versus CSS-based webpage design: resources,
explanations and tutorials
http://www.gtalbot.org/NvuSection/Nv...CSSDesign.html

Gérard
--
remove blah to email me
Apr 4 '06 #9

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

Similar topics

5
by: Applebrown | last post by:
Hello, basically, I'm just learning intermediate CSS and trying to convert my old table webpage completely to CSS. Hoorah, right? Well, it's not quite going as planned. It's an extremely simple...
0
by: Mark Moore | last post by:
I'm trying to layout a couple text input fields and their corresponding labels without using a table. When I was trying to debug my understanding of CSS, I was *very* surprised to see that span's...
1
by: neverstill | last post by:
hi- I have a table on a page there is 1 row and 2 cells cell 1 has a user control that is basically just a DataList nested in a table o fit's own. then, below that user control I have some <p>...
1
by: Amar | last post by:
I have a web form with several fields. Depending on user selection in one combo box, i populate a text box and a check box in one line. For example if the user selects 2 years, then i show the...
1
by: Bart Schelkens | last post by:
i've created a webpage. On this webpage i have a table. Now for some reason there is a white space of about 0,5cm at the right side of my table. I told my table width="100%" Can anyone explain...
2
by: shagy | last post by:
Hi, I'm having a problem with a <select><option> which has white space in values... When I post the data I only get the first word (up to the white space). "Testing white space" becomes...
12
by: JA | last post by:
Is there a way to remove all the white space in the fields? I have been using Find-and-replace - looking for 2 or 3 or 4 or 10 spaces and replacing them with none. I don't want to replace single...
3
by: amandadev | last post by:
Hi there, Please take a look at: bluecelery.amandadevries.com/index.html as well as the CSS and tell me why there is a white space in the table in Firefox (that looks like a white...
4
by: Don Miller | last post by:
When an ASP.NET 2.0 web page is rendered with multiple web controls hidden from view (.visible=false) there is a noticeable gap between a rendered element (like a table) and the next visible...
2
by: progvar | last post by:
Hi i have not any idea how to remove white space in vb actualy i am accessing value from table some time the column is null and some time it contain space means user press space bar to remove data...
0
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,...
0
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...
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...
1
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...
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
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.