Pestacarne
Pestacarne

Reputation: 9

I want to make a line under the text in my table

I would like to make a border/frame under the text as same as the photo below

enter image description here

      table.blueTable {
      background-color: #5F80A8;
      height: 200px;
      width: 50%;
      margin: auto;
      position: relative;
      bottom: -165px;
      color: white;
    }

    table.blueTable td {
      font-size: 1.3em;
    }

    #uno,
    #tre,

    {
      text-align: center;
      line-height: 4em;
    }

    #due,
    #quattro,

    {
      text-align: left;
    }
<!DOCTYPE html>
    <html lang="ja">

    <head>
    	<meta charset="UTF-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1">

    	<title>table6</title>
      <table class="blueTable">
    <tbody>
    <tr>
    <td id="uno">初期費用</td>
    <td id="due">15万~30万<br>(選択プランによる</td>
    </tr>
    <tr>
    <td id="tre">月額費用</td>
    <td id="quattro">5万~15万<br>(選択プランによる)<br>+SMS送信料 12円/通<br>+IVR利用料 8円/60秒</td>
    </tr>
    </tbody>
    </tr>
    </table>
</body>
</html>

Upvotes: 2

Views: 88

Answers (2)

Rajesh
Rajesh

Reputation: 262

Can you add cellspacing to your table tag. Hope this will solve the issue.

 <table class="blueTable" cellspacing="30">
   <tbody>
     <tr>
     <td></td>
     </tr>
  </tbody>
</table>

table.blueTable td {
 font-size: 1.3em;
 border-bottom: 1px solid #fff;
 border-right: 1px solid #fff;
 }

Upvotes: 0

Roma
Roma

Reputation: 199

You can add css for table border as below:

    td, th {
border: solid 1px;
border-left: none;
border-top: none;
} 

Here is your updated code:

      table.blueTable {
      background-color: #5F80A8;
      height: 200px;
      width: 50%;
      margin: auto;
      position: relative;
      bottom: -165px;
      color: white;
    }
 
    td, th {
    border: solid 1px;
    border-left: none;
    border-top: none;
} 

    table.blueTable td {
      font-size: 1.3em;
       border-bottom: 1px solid #fff;
    }

    #uno,
    #tre,

    {
      text-align: center;
      line-height: 4em;
    }

    #due,
    #quattro,

    {
      text-align: left;
    }
<!DOCTYPE html>
    <html lang="ja">

    <head>
    	<meta charset="UTF-8">
    	<meta name="viewport" content="width=device-width, initial-scale=1">

    	<title>table6</title>
      <table class="blueTable">
    <tbody>
    <tr>
    <td id="uno">初期費用</td>
    <td id="due">15万~30万<br>(選択プランによる</td>
    </tr>
    <tr>
    <td id="tre">月額費用</td>
    <td id="quattro">5万~15万<br>(選択プランによる)<br>+SMS送信料 12円/通<br>+IVR利用料 8円/60秒</td>
    </tr>
    </tbody>
    </tr>
    </table>
</body>
</html>

Hope this helps !

Upvotes: 2

Related Questions