Home  >  Q&A  >  body text

The title is rewritten as: "TD displays abnormality"

<tr> 
    <td></td> 
    <td colspan="3">Susi Handayani Jl. Kebangsaan No.225 300.000</td> 
</tr>

How to merge two tds into one td but they don't stick together, I want the text not to stick together and leave some space from the deleted td to make it the same as the columns above

I tried aligning but it didn't work, I also tried splitting the tr and tried removing the td of one paragraph but it still stuck with the second paragraph (td), what I expected was that the td didn't stick to together, but align the text above the text I made

<h3>Tabel HTML</h3>
<table>
<caption>Tabel Simpanan Peserta</caption>
  <thead>
    <tr>
      <th>No</th>
      <th>Nama Peserta</th>
      <th>Alamat</th>
      <th>Simpanan</th>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td colspan="3">Total</td>
    <td>350.000</td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <td>1.</td>
      <td>Andi Suryono</td>
      <td>Jl. Kemerdekaan No.17</td>
    <td>50.000</td>
    </tr>
    <tr>
      <td>2.</td>
        <td colspan="3">Susi Handayani
        Jl. Kebangsaan No.225
        300.000</td>
    </tr>
    <tr>
        <td>3.</td>
        <td>Roy Pratama</td>
        <td>Jl. Merdeka No.32</td>
      <td>1.000.000</td>
      </tr>
    </tr>
    <tr>
      <td>4.</td>
      <td>Tia Suryani</td>
      <td>Jl. Jelajah No.111</td>
    <td>1.555.000</td>
    </tr>
  </tbody>
</table>

I'm trying to make the table blend together but not stick together, I plan to leave some space for the text, how do I create space for each column

P粉147747637P粉147747637420 days ago1010

reply all(1)I'll reply

  • P粉187160883

    P粉1871608832023-09-16 09:07:46

    You're talking about styles, but you didn't post any style tags or CSS. Please post your generic CSS that reproduces the problem, or at least provide a screenshot of the problem.

    Usually, the spacing in the table is achieved through padding. Try code like this:

    <style>
    td { 
        padding: 5px 10px;
    }
    </style>

    This will add 5px of space above and below each cell in the table, and 10px on both sides.

    reply
    0
  • Cancelreply