|
Web Development & Graphic Design Problem Solving for Graphic Design, PHP, ASP, Perl, MySQL, SQL, XML, HTML issues |
|
Topic Tools |
#1
|
|||
|
|||
HTML Cell Spacing Too Big
Hi I am trying to remove spacing around HTML generated table cells & would like to remove the white space generated by the following code as shown here above the name SMITH:
Code:
<html> <body> <table style="width: 259px; height: 71px"> <tbody> <tr> <td style="width: 247px; height: 25px"> ROGER<table style="height: 1px; width: 248px;"> <tbody> <tr style="background-color: #e6e6e6"> <td style="width: 128px"> <p> JOHN</p> </td> </tr> <tr> <tr> </tr> </tbody> </table> </td> </tr> </tbody> </table> SMITH </body> </html> |
#2
|
|||
|
|||
Table tags need to remove the default spacing.
Code:
<table cellspacing="0" cellpadding="0" border="0" style="padding: 0; margin:0;"> <tr> <td> </td> </tr> </table> |
#3
|
|||
|
|||
Thanks very much, I've tried removing the defaults with the local code as follows but this alone isn't allowing me to remove the space I'm using browser IE6 & the reason for nesting is I have very large program within this existing arrangement though I may next try to alter nested table arrangement to get round problem
Quote:
|
#4
|
||||
|
||||
I can't remember for certain but I think that tables use a default value of 3 for unspecified cellpadding and cellspacing. That's why it changes if you specify 0. It helps when troubleshooting tables if you temporarily specify border="1" so your table is visible.
Put SMITH inside the same main table as the other entries. That's the reason for the extra white space. (The other names are in the main table but SMITH isn't.) Also, in your last post you have an extra tr tag that doesn't have an end tag and a row that doesn't have enclosed td tags. Some browsers don't like that. Code:
JOHN</p> </td> </tr> <tr> <tr> </tr> </tbody> |
#5
|
|||
|
|||
You've also got some improperly formatted HTML. Table Rows need to contain table cells and they should all be closed.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <body> <table cellspacing="0" cellpadding="0" border="0" style="width: 259px; height: 71px; padding: 0; margin:0;"> <tbody> <tr> <td style="height: 25px">ROGER</td> <td style="width: 128px">JOHN</td> <td>SMITH</td> </tr> </tbody> </table> </body> </html> |
Bookmarks |
«
Previous Topic
|
Next Topic
»
|
|
Similar Topics | ||||
Topic | Topic Starter | Forum | Replies | Last Post |
Landing Page Spacing Errors | It'sMe | Comments & Suggestions | 3 | October 22nd, 2011 10:01 AM |
Whyyy? Css spacing and centering | Zodiac_Rkx | Web Development & Graphic Design | 6 | April 23rd, 2011 05:23 PM |
Removal of HTML/Dldr.Barf.A HTML Script Virus | neilp02 | Malware Removal | 1 | February 15th, 2011 06:21 AM |
Modified registry values regarding icon size & spacing, need original values | Gnodab | Windows XP | 4 | April 7th, 2008 09:31 PM |
MS Word Line Spacing Default | thejollyhatter | Applications | 3 | August 27th, 2002 11:19 PM |
All times are GMT +1. The time now is 06:26 AM.