Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  pop ups with CSS  CSSNext Question:  A few issues  CSS

Question margins simple question. ( SitePoint Forums CSS )
Updated: 2008-11-23 03:45:02 (3)
margins simple question.

hey crazy sitpoint catz

- i have a quick / stupid question... for whatever reason i can't get my margins to work

i have a table and inside of it i wanted to give my paragraphs a margins of 10px on the left & right

i've tried doing it as divs, spans, nothing seems to work.
do i have to apply it to my table or the paragraph inside the cell ?

thanks !


Answers: margins simple question. ( SitePoint Forums CSS )
margins simple question.

Try adding padding to the table (padding: 10px.

The New Guy

margins simple question.

I think you mean td {padding:25px}

Quote:
i've tried doing it as divs, spans, nothing seems to work.
Have you got example code as I've just put margins on a p tag inside a table with no problems.
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">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
p {background:blue;margin:0 10px;}
table {border-collapse:collapse;border:1px solid #000}
td {border:1px solid #000}
</style>
</head>
<body>
<table width="50%" cellspacing="0" cellpadding="0">
  <tr> 
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td><p>Hello</p></td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
	<td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
Paul

Paul O'B

margins simple question.

thanks
yeah.. i keep taking nearly 6 months long breaks from web stuff... its between that & graphics/layout - and sometimes when i come back to it i'm a little "rusty"

Thanks again

*
n

ktown

Previous Question:  pop ups with CSS  SitePoint Forums  CSSNext Question:  A few issues  SitePoint Forums  CSS

- Source: margins simple question. SitePoint Forums CSS
- Previous Question: pop ups with CSS SitePoint Forums CSS
- Next Question: A few issues SitePoint Forums CSS





AllQuests.com


Best dedicated servers   Top dedicated servers   Cheap dedicated servers   Linux dedicated servers   Windows dedicated servers   Unmetered dedicated servers