html - 我想在表格中的文本下划一条线

标签 html css

我想在文本下制作一个边框/框架,与下面的照片相同

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>

最佳答案

您可以为表格边框添加CSS,如下所示:

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

这是您更新的代码:

      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>

希望这有帮助!

关于html - 我想在表格中的文本下划一条线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54996736/

相关文章:

javascript - 如何使用 jquery ajax 同时更新两个 div?

html - Bootstrap 中的对齐标签和输入

html - 显示 : inline-block issues

javascript - 如何自动扩展用户选择的文本

html - 选择仅包含 css 的事件 a 标签的包含 tr

css - 在列表中 float 会导致 IE6 和 IE7 出现问题

jquery - 单次 CSS3 变换后的双重 CSS3 变换

javascript - Bootstrap 折叠导航栏不展开

javascript - 脚本已完成但返回值不是受支持的返回类型

html - CSS - 由于 * 定义无法覆盖 P.class