...

View Full Version : google chrome seems to ignore cellpadding + cellspacing



arabab
09-07-2011, 02:20 AM
ok so i have a table with a tr and two tds. first td contains an input(text), the second another input(image). the second input is supposed to be a button. ive set cellpadding and cellspacing to zero so that the text input and the image button can be attached with no spaces in between. this works fine in IE and FF but not in chrome. chrome keeps leaving a few pixels of space between the txt input and the button. i tried using css but nothing seems to work. any idea what chrome's problem might be?

teedoff
09-07-2011, 02:40 AM
Well since you didn't provide your site link or code, I can just guess and suggest setting a global reset:

Add this to your stylesheet

* {padding: 0; margin: 0; border: 0;}

arabab
09-07-2011, 02:55 AM
yeah that one works but i don't want to use it. sorry here's the code



<head>

<style type="text/css">
.search{
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: normal;
color: #4D4D4D;
border: 1px solid #CCCCCC;
height: 21px;
outline: none;
}
</style>

</head>

<body>

<table cellpadding="0" cellspacing="0">
<form method="post">
<tr><td><input type="text" size="30" class="search"></td>
<td><input type="image" src="button.gif" name="submit" id="submit" width="77px" height="21px"></td></tr>
</form>
</table>

</body>

teedoff
09-07-2011, 03:01 AM
If the global reset works, whats wrong with using it?

This rule sets all elements to 0 margin, padding, and borders. Different browsers apply different values to elements by default. Starting with all of them at 0 provides a "clean slate" so to speak. Then when you want to add those values on elements, you can do so specifically to each element.

arabab
09-07-2011, 03:53 AM
If the global reset works, whats wrong with using it?

This rule sets all elements to 0 margin, padding, and borders. Different browsers apply different values to elements by default. Starting with all of them at 0 provides a "clean slate" so to speak. Then when you want to add those values on elements, you can do so specifically to each element.


this can potentially effect the rest of my design. is there anything more specific that i can use? thanks for the replies by the way.

arabab
09-07-2011, 04:12 AM
ok fixed it. needed a margin:0 for the text input element because apparently the margins belonged to that element and had nothing to do with the table. weird.

teedoff
09-07-2011, 04:54 AM
ok fixed it. needed a margin:0 for the text input element because apparently the margins belonged to that element and had nothing to do with the table. weird.

Glad you got it working.

Just a link to some reading about the use of global resets (http://www.html-advisor.com/css/what-is-global-css-reset/) and their advantages.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum