Mon, 2009-06-22 17:36
Evening
I have a very simple question that I just can't find the answer to. Take this simple html table with a and
tag:
<!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> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Title</title> </head> <body> <table border="1"> <tr> <td> <h2>This is the heading</h2> <p>This is a test</p> </td> </tr> </table> </body> </html>
How can I make it so that the and
tags are closer together (the height). I know I can do it by adding
* { margin: 0; padding: 0; }
But I only want it applied within that
(and before anyone asks I do need it in a table! )
Thanks
Mon, 2009-06-22 17:41
#1
td h2, td p {margin: 0;}
td h2, td p {margin: 0;}
Mon, 2009-06-22 17:57
#2
why do you need a heading
why do you need a heading and paragraph in a table cell? If it's tabular data, are using th?
Mon, 2009-06-22 20:36
#3
Wolfcry is right. If "you do
Wolfcry is right. If "you do need a table" then you need to use table headings.
<table> <thead> <tr> <th>Heading 1</th> <th>Heading 2</th> <th>Heading 3</th> </tr> </thead> <tbody> <tr> <td>Row 1</td> <td>Row 2</td> <td>Row 3</td> </tr> </tbody> /*If neccesary you can have <tfoot></tfoot> */ </table>