Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
嵌入的html样式不影响表?_Html_Css_Html Table - Fatal编程技术网

嵌入的html样式不影响表?

嵌入的html样式不影响表?,html,css,html-table,Html,Css,Html Table,我试图使用样式来影响html表中单元格的间距。 我试图用边距使我的单元格只有右边的间距。 我做错了什么?如何使用样式影响单元格间距 <html> <head> <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1"> <style> body { font-family: Verdana, Arial, Helvetica, sans-serif

我试图使用样式来影响html表中单元格的间距。 我试图用边距使我的单元格只有右边的间距。 我做错了什么?如何使用样式影响单元格间距

<html>
  <head>
    <meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">

<style>
body {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 9pt;
}

table {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 9pt;
}

td {
  margin: 0px 20px 0px 0px;
  color: #585858;
}

a {
  color: #326ea1;
}
</style>

    <title>Request</title>
  </head>
  <body>

    <table border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td> Request ID </td>
          <td>516<br>
          </td>
        </tr>
        <tr>
          <td>Assigned<br>
          </td>
          <td>Fred Flintstone<br>
          </td>
        </tr>
        <tr>
          <td>Requestor<br>
          </td>
          <td>Bugs Bunny<br>
          </td>
        </tr>
        <tr>
          <td>Type<br>
          </td>
          <td>Construction<br>
          </td>
        </tr>
        <tr>
          <td>Location<br>
          </td>
          <td>Brazil<br>
          </td>
        </tr>
        <tr>
          <td> <br>
          </td>
          <td> <br>
          </td>
        </tr>
        <tr>
          <td style=" vertical-align: top;">Description</td>
          <td>Lorem ipsum dolor sit amet, consectetur adipisicing elit, <br>
              sed do eiusmod tempor incididunt ut labore et dolore <br>
              magna aliqua. Ut enim ad minim veniam, quis nostrud <br>
              exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
          </td>
        </tr>
        <tr>
          <td><br>
          </td>
          <td><br>
          </td>
        </tr>
      </tbody>
    </table>

  </body>
</html>

身体{
字体系列:Verdana、Arial、Helvetica、无衬线;
字号:9pt;
}
桌子{
字体系列:Verdana、Arial、Helvetica、无衬线;
字号:9pt;
}
运输署{
保证金:0px 20px 0px 0px;
颜色:#5858;
}
a{
颜色:#326ea1;
}
要求
请求ID
516
分配的
弗雷德·弗林斯通
请求者
兔八哥
类型
构造
位置
巴西


描述 Lorem ipsum dolor sit amet,奉献精英,
临时劳工和福利费的费用
麦格纳阿利夸。但是,我们要尽量少花钱,不要浪费时间
ullamco Laboraris nisi ut aliquip ex ea commodo consequat实习。


不幸的是,表格单元格没有边距属性,但您可能可以在其上设置填充以获得所需的行为。W3Schools提供了一个关于样式表的页面,可以帮助您:

如果您将代码更改为以下内容,它应该可以工作:

td {
 padding: 0px 20px 0px 0px;
 color: #585858;
}

还可以在表上设置单元格间距属性。这将在单元格边界之间留出空间-但是,这会影响单元格各边周围的间距。

这既快又容易!谢谢