NONEYou can't use those attributes to refer to class names.
/* Awesome class name for a table, by the way. */
table.top {
border-collapse: collapse;
border-width: 1px;
}
table.top td, table.top th {
padding: 5px;
}NONEDude, maybe you should try learning what a class is before trying to code in CSS. Use my code, with this HTML.
<table class="top">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td>Entry 1</td>
<td>Entry 2</td>
</tr>
</table>NONEIf you don't want headings then take them out.NONEtable.top {
border-collapse: collapse;
border-style: solid;
border-width: 1px;
border-color: #000;
}
<table class="top">NONEChange your table tag to this:
<table class="top">
Then add the following CSS code to your table.top styles
border: 1px solid #fff;
Then the following to your stylesheet:
table.top td {
padding: 5px;
border: 1px solid #fff;
}
Also, remove the HTML code from your stylesheet. NONETry this, if it does not work, I suggest you visit the CSS spec. (<!-- m --><a class="postlink" href="http://www.w3.org/Style/CSS/">http://www.w3.org/Style/CSS/</a><!-- m -->) and read it until it makes sense.How would one code CSS so that there is no cell spacing as well?Tip - don't use a table (if this is for a layout).How would one code CSS so that there is no cell spacing as well?td {padding: 0; margin: 0;}td {padding: 0; margin: 0;}
hmmm the margin didn't seem to change anything. This is my code...
table.normal td{
border-collapse:collapse;
padding:0;
margin:0;
}
/* Awesome class name for a table, by the way. */
table.top {
border-collapse: collapse;
border-width: 1px;
}
table.top td, table.top th {
padding: 5px;
}NONEDude, maybe you should try learning what a class is before trying to code in CSS. Use my code, with this HTML.
<table class="top">
<tr>
<th>Heading 1</th>
<th>Heading 2</th>
</tr>
<tr>
<td>Entry 1</td>
<td>Entry 2</td>
</tr>
</table>NONEIf you don't want headings then take them out.NONEtable.top {
border-collapse: collapse;
border-style: solid;
border-width: 1px;
border-color: #000;
}
<table class="top">NONEChange your table tag to this:
<table class="top">
Then add the following CSS code to your table.top styles
border: 1px solid #fff;
Then the following to your stylesheet:
table.top td {
padding: 5px;
border: 1px solid #fff;
}
Also, remove the HTML code from your stylesheet. NONETry this, if it does not work, I suggest you visit the CSS spec. (<!-- m --><a class="postlink" href="http://www.w3.org/Style/CSS/">http://www.w3.org/Style/CSS/</a><!-- m -->) and read it until it makes sense.How would one code CSS so that there is no cell spacing as well?Tip - don't use a table (if this is for a layout).How would one code CSS so that there is no cell spacing as well?td {padding: 0; margin: 0;}td {padding: 0; margin: 0;}
hmmm the margin didn't seem to change anything. This is my code...
table.normal td{
border-collapse:collapse;
padding:0;
margin:0;
}