DCR
DCR

Reputation: 15685

two identical html tables display differently

why do these tables display differently?

<table>
  <tbody>
    <tr>
      <td style="width:20%;"><b><u>Date</u></b></td>
      <td style="width:20%;"><b><u>Invested</u></b></td>
      <td style="width:30%;"><b><u>Company (and Round)</u></b></td>
      <td style="width:30%;"><b><u>SPV</u></b></td>
    </tr>
  </tbody>
</table>

<br><br><br>


<table>
  <tbody>
    <tr>
      <td style="width:20%;"><b><u>Date</u></b></td>
      <td style="width:20%;"><b><u>Invested</u></b></td>
      <td style="width:30%;"><b><u>Company (and Round)</u></b></td>
      <td style="width:30%;"><b><u>SPV</u></b></td>
    </tr>
  </tbody>
</table>

Upvotes: 0

Views: 45

Answers (2)

j08691
j08691

Reputation: 207900

As I surmised in my comment above, the space in <td style="width:20%;"> is a non-breaking space (U+00A0 : NO-BREAK SPACE [NBSP]) which can render as <tdstyle="width:20%;">. Just delete the sapce between td and style and enter a proper space and you're fine. Character identified via https://www.babelstone.co.uk/Unicode/whatisit.html

Upvotes: 0

s.kuznetsov
s.kuznetsov

Reputation: 15213

The difference is here, in the screenshot. In the DOM structure, in this line there is a space, like $nbsp. Perhaps you copied this line from another editor. Use it:

<table>
  <tbody>
    <tr>
      <td style="width:20%;"><b><u>Date</u></b></td>
      <td style="width:20%;"><b><u>Invested</u></b></td>
      <td style="width:30%;"><b><u>Company (and Round)</u></b></td>
      <td style="width:30%;"><b><u>SPV</u></b></td>
    </tr>
  </tbody>
</table>

<br><br><br>

<table>
  <tbody>
    <tr>
      <td style="width:20%;"><b><u>Date</u></b></td>
      <td style="width:20%;"><b><u>Invested</u></b></td>
      <td style="width:30%;"><b><u>Company (and Round)</u></b></td>
      <td style="width:30%;"><b><u>SPV</u></b></td>
    </tr>
  </tbody>
</table>

Upvotes: 1

Related Questions