Arko Elsenaar
Arko Elsenaar

Reputation: 1729

Border on table row instead on td - missing td's

I have a table that is generated by PHP. I wanted to style the table a bit, so there is a border-bottom on every row.

I used border-collapse: collapse; so I don't have to apply the border to the td. I have reproduced my problem here:

http://codepen.io/anon/pen/zvpKBE

I would like to have every horizontal border as long as the row is. When I inspect my row, it's long enough, but the border is only applied to the td's in it.

Upvotes: 0

Views: 1140

Answers (1)

Nandu Hulsure
Nandu Hulsure

Reputation: 133

Your (td)header columns and data columns should be equal to have the border fully. Like below

    <table>
      <tbody><tr>
        <td>This is an test</td>
        <td>Second field</td>
        <td>Third field</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
       <td>&nbsp;</td>
   <td>&nbsp;</td>
      </tr>
      <tr>
     <td>&nbsp;</td>
    <td>&nbsp;</td>
   <td>&nbsp;</td>
      </tr>
    </tbody>

Upvotes: 1

Related Questions