I am using a table with 1 column and three rows. I would like to give all 3 rows a solid, continuous background color. How could I do this?
Thanks in advance,
John
echo "<table class=\"samplesrec\">";
echo '<tr class="class2">';
echo '<td class="sitename1"></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2name"></td>';
echo '</tr>';
echo '<tr>';
echo '<td class="sitename2"></td>';
echo '</tr>';
echo "</table>";
If you collapse the borders and put no spacing between it will make a solid background.
table {
border-collapse:collapse;
border-spacing:0;
}
http://jsfiddle.net/robert/HpQjd/
This will make the column have a blue background and black border on the sides.
.samplesrec
{
border-collapse: collapse;
border-spacing: 0px;
}
.samplesrec td
{
border: 0px 1px;
border-style: solid;
border-color: #000000;
background-color: #0000ff;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With