Html 将底部边框添加到所有表数据单元格

Html 将底部边框添加到所有表数据单元格,html,css,Html,Css,我是否可以避免将边框规格写入每个表数据单元 <table width='800' bgcolor='grey' cellspacing='0' style="border-bottom-style:solid; border-bottom-width:1px; border-color:black"> <tr> <td style="border-bottom-style:solid; border-bottom-width:1px;"> First Nam

我是否可以避免将边框规格写入每个表数据单元

<table width='800' bgcolor='grey' cellspacing='0'
style="border-bottom-style:solid; border-bottom-width:1px; border-color:black">  <tr>
<td style="border-bottom-style:solid; border-bottom-width:1px;">
First Name:<td style="border-bottom-style:solid;
 border-bottom-width:1px;"> {$info['firstname']}</td></tr>
 <tr><td style="border-bottom-style:solid; 
border-bottom-width:1px;">Last Name:
<td style="border-bottom-style:solid; border-bottom-width:1px;">
{$info['lastname']}</td> </tr>
<tr><td style="border-bottom-style:solid; border-bottom-width:1px;">
email:<td       style="border-bottom-style:solid; border-bottom-width:1px;">
{$info['email']}</td></tr>
<tr><td>password:<td>********</td></tr>

名字:{$info['firstname']}
姓氏:
{$info['lastname']}
电邮:
{$info['email']}
密码:********

这是基本的CSS。将以下内容放在文档的开头:

<style type="text/css">
    td {
      border-bottom-style:solid;
      border-bottom-width:1px;
    }
</style>
或使用:


您可能需要查看一个。

这是基本的CSS。将以下内容放在文档的开头:

<style type="text/css">
    td {
      border-bottom-style:solid;
      border-bottom-width:1px;
    }
</style>
或使用:

您可能需要查看一个。


表td
{
边框底部:1px纯黑;
}

表td
{
边框底部:1px纯黑;
}
使用CSS

td {
    border-bottom: solid 1px black;
}
建议您在另一个文件中编写CSS,并使用以下方法将其包含在网页中:

<link rel=StyleSheet href="example.css"/>

更多关于CSS的信息请点击此处:

使用CSS

td {
    border-bottom: solid 1px black;
}
建议您在另一个文件中编写CSS,并使用以下方法将其包含在网页中:

<link rel=StyleSheet href="example.css"/>


更多关于CSS的信息请点击此处:

您的代码应该如下所示

<html>
  <head>
    <style>
      table{
        background-color: grey;
        width: 800px;
        border-bottom: 1px solid black;
        border-spacing: 0;
        border-collapse: collapse;
      }
      table tr td{
        border-bottom: 1px solid black;
      }
    </style>
  </head>
  <body>
    <table cellspacing='0'>  
      <tr>
        <td>First Name:</td>
        <td> {$info['firstname']}</td>
      </tr>
      <tr>
        <td>Last Name:</td>
        <td>{$info['lastname']}</td> 
      </tr>
      <tr>
        <td>email:</td>
        <td>{$info['email']}</td>
      </tr>
      <tr>
        <td>password:</td>
        <td>********</td>
      </tr>
    </table>
  </body>
</html>

桌子{
背景颜色:灰色;
宽度:800px;
边框底部:1px纯黑;
边界间距:0;
边界塌陷:塌陷;
}
表tr td{
边框底部:1px纯黑;
}
名字:
{$info['firstname']}
姓氏:
{$info['lastname']}
电邮:
{$info['email']}
密码:
********

您的代码应该是

<html>
  <head>
    <style>
      table{
        background-color: grey;
        width: 800px;
        border-bottom: 1px solid black;
        border-spacing: 0;
        border-collapse: collapse;
      }
      table tr td{
        border-bottom: 1px solid black;
      }
    </style>
  </head>
  <body>
    <table cellspacing='0'>  
      <tr>
        <td>First Name:</td>
        <td> {$info['firstname']}</td>
      </tr>
      <tr>
        <td>Last Name:</td>
        <td>{$info['lastname']}</td> 
      </tr>
      <tr>
        <td>email:</td>
        <td>{$info['email']}</td>
      </tr>
      <tr>
        <td>password:</td>
        <td>********</td>
      </tr>
    </table>
  </body>
</html>

桌子{
背景颜色:灰色;
宽度:800px;
边框底部:1px纯黑;
边界间距:0;
边界塌陷:塌陷;
}
表tr td{
边框底部:1px纯黑;
}
名字:
{$info['firstname']}
姓氏:
{$info['lastname']}
电邮:
{$info['email']}
密码:
********