Jump to content

Gaps in Tables


JohnCP

Recommended Posts

Hi, I've searched everywhere and could not resolve this..apparently, there are gaps from my table and my browser. Also, I have a text gap in my middle table cell from the top. I have tried to get rid of cellspacing but that doesn't seem to resolve the issue. I am sorry I was not able to provde a screen shot of my problem, but the code is below. The "gap" problem resides at the top of my table. I'm thinking it could be a default header issue? Thanks in advance, John Park

<HTML><TITLE>Welcome to EDMTalk!  Login or Register Now!!</TITLE><body><table border="0" width="75%" align="center" cellpadding="5" cellspacing="0" style="border-collapse: collapse;">	<tr>  <td width="20%" bgcolor="black"  valign="top">  <font face = "arial" color = "white" ><h1><i>EDM</i> Talk  <img src="discoball.gif" align="center">  </td>  <td width="%60"  valign="top" border="2" cellspacing="0"><font face="helvetica">  <font size="1">  <a href="http://www.denon.com/"><img src="cdj1000.gif"  align="right" border="0"></a><br>  Welcome to <i>EDM</i> Talk, a place dedicated for DJ's, Producers, or just avid fans of the music to discuss anything regarding the scene. etc...</body></html>

Link to comment
Share on other sites

Replace this code with the code you have at the start, the <table> bit.<div style="position:absolute; top:0px; left:256px"><table border="1" width="75%" cellspacing="0">Now for the left:256px thats centering the table in an 1152x864 screen. So you'd have to change it to fit a 1024x768 screen. To do so, you just take 1024x0.25 (space not taken up by the table). Then divide that answer by 2 (space on each side). So you should replace the 256 with 128. Now I removed the cellpadding="5" because all that does is increase the width of your border which you have set to 0. Also seeing as this is being made in <div> layers, you can't use the align=center in the <table> code. And you can get rid of the style="border-collapse: collapse;" because you previously told it to have a border of 0.

Link to comment
Share on other sites

I copied your code and pasted it into my text editor. You have a <br> tag right before your "Welcome to..." message. The cellpadding will also push your message down a little. Using CSS will give you much more flexibility as far as applying padding. For instance, you can apply 5px of padding to the left of your message but zero to the top.I think it would be best if you either used the style attribute or the cellspacing attribute, not both.Hope this helps.lugos

Link to comment
Share on other sites

I could be mistaken but it sounds as if JohnCP was referring to the table not being at the very top of the screen, which my modification will fix. Sorry if I interpreted your question wrong.

yes, selacius, you are correct, that is my issue, the table not being at the very top of the screen. Your modification is perfect, however, is using CSS the only method to solve this problem, or is there a way to fix via HTML alone? just curious, Thanks, JP
Link to comment
Share on other sites

yes, selacius, you are correct, that is my issue, the table not being at the very top of the screen. Your modification is perfect, however, is using CSS the only method to solve this problem, or is there a way to fix via HTML alone? just curious, Thanks, JP

I didn't use CSS to fix your problem. I used DIV layering to fix it.
Link to comment
Share on other sites

Yes there is. The best way to do it (and definitely the one you should use) is to simply remove the body's top margin. Or all body margins. Yes, CSS is the only "standard" way, as the rest is just propriety markup.

body {   margin-top: 0; /* or margin: 0; for all margins */}

I just understood the topic at hand, so that's why I didn't answer this sooner, sorry.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...