Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: HTML
 <table id="tab" width="100%" style="border-right-style: solid; border-right-width: thin" cellspacing="0" cellpadding="0" border="0" >
 <tr>
 <td   align="left" width="60%" style="border-right-style: solid ; border-right-width: thin" height="100%" colspan="0" rowspan="0" valign="middle">
  </td>
  <td  align="right" width="40%" height="100%" colspan="0" rowspan="0" valign="middle">
   </td>                                    
Posted 7-Nov-12 3:07am
Comments
Tadit Dash at 7-Nov-12 8:21am
   
With this code, I cannot find any cell space.
There is no space. They are next to each other.
Sergey Alexandrovich Kryukov at 7-Nov-12 12:54pm
   
If you load this HTML in the browser, you will see that td are stretched to sided of the window...
Besides, with formally 0 padding + 0 margin still there is a tiny gap, depending on layout engine; I doubt it can be reduced.
--SA
Tadit Dash at 7-Nov-12 13:10pm
   
I am unable to find that gap.
Can you please show me that gap in an image ?
Thanks...
Sergey Alexandrovich Kryukov at 7-Nov-12 16:54pm
   
How can I show it?
load this to a Browser:
 
<table>
<tr>
<td>MMM</td><td>HHH</td>
</tr>
</table>
 
I've chosen MMM and HHH on purpose, to see the gap between M and H. I depends on the layout engine.
--SA
Bala Selvanayagam at 7-Nov-12 8:26am
   
Are you using style sheet ?
 
if so, please post the releveant section.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Remove all style, width and cellspacing attributes from this HTML, and you will see that the gap is greatly reduced. Smile | :)
 
Please see my comment to the question.
 
Next time, never ever do such things. Use CSS and only CSS, and always in separate link or style elements under the head element. How? Well, you did not tell us what rendering you want to achieve. Do it the right way first, and then, if you fail, ask another question, but then describe your goal in detail.
 
On proper referencing of CSS in HTML documents or embedding them, please see:
http://www.w3.org/TR/html4/present/styles.html[^].
 
To learn styles, start here:
http://en.wikipedia.org/wiki/CSS[^],
http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28CSS%29[^],
http://www.w3.org/Style/CSS/[^].
 
This can be a useful tool for you: http://www.webtutorialplus.com/css3-generator.aspx[^].
 
—SA
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 7-Nov-12 23:55pm
   
I told you how to do it. Did you get it?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 7,205
1 DamithSL 5,114
2 Maciej Los 4,866
3 Sergey Alexandrovich Kryukov 4,747
4 Kornfeld Eliyahu Peter 4,474


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 7 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100