Kristen L
Kristen L

Reputation: 65

HTML table: remove space between two td tag

How I can remove this space from tag.

    <table width="100%">
    <thead>
      <tr>
        <td>Filename</td>
      <td colspan="2">DateTime</td>
      <td>Size</td>
      </tr>
    </thead>
  <tbody >
    <tr>
      <td>43343434.jpg</td>
      <td>18/02/2015</td>
      <td> - 18:32:54</td>
      <td>55MB</td>
    </tr>
  </tbody>
</table>

Image: enter image description here

So it looks like 18/02/2015 - 18:32:54

I dont want to add time into same tag.

Upvotes: 0

Views: 1802

Answers (3)

Banzay
Banzay

Reputation: 9470

you need to define css:

tbody tr > td:nth-child(2) {
  width: 5%;
}
tbody tr > td{
  width: 45%;
}

https://jsfiddle.net/yerz2dg2/

Upvotes: 1

Bhavanaditya
Bhavanaditya

Reputation: 558

Try this code.

HTML Code

<table border="1" width="100%">
  <tr>
    <th col width="60">File Name</th>
    <th col width="20" colspan="2">Date Time</th> 
    <th col width="20">Size</th>
  </tr>
  <tr>
    <td col width="60">1.jpg</td>
    <td col width="10">18-02-2015</td>
    <td col width="10">18:32:54</td>
    <td col width="20">55Mb</td>
  </tr>
</table>

Upvotes: 0

Rohith K D
Rohith K D

Reputation: 275

Include following property in table tag

cellpadding="0" cellspacing="0"

<table cellpadding="0" cellspacing="0" border="0">
<!-- table elements --!>
</table>

Upvotes: 0

Related Questions