Making the table rows solid continuous background color

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 can 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>";
+3
source share
4 answers

If you destroy the borders and do not set the spacing between them, you will create a solid background.

table {
    border-collapse:collapse;
    border-spacing:0;
}

http://jsfiddle.net/robert/HpQjd/

+5
source
.sitename1
{
   background-color: xxx;
   border-left: 1px solid xxx;
   border-right: 1px solid xxx;
}

may be?

0
source

? , .

.samplesrec{
  background-color:#XXX;
}
0

, .

.samplesrec
{
  border-collapse: collapse;
  border-spacing: 0px;
}

.samplesrec td
{
  border: 0px 1px;
  border-style: solid;
  border-color: #000000;
  background-color: #0000ff;
}
0

Source: https://habr.com/ru/post/1769631/


All Articles