Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.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_Text_Html Table_Tableheader - Fatal编程技术网

Html 如何使表格标题中的文本不加粗?

Html 如何使表格标题中的文本不加粗?,html,text,html-table,tableheader,Html,Text,Html Table,Tableheader,我需要为我的表使用行跨度,因此我(相信)我必须使用表头。但是,使用表头会使我的字体变粗,这是不需要的。对于这个HTML,我如何确保我的表格标题中的字体不是粗体?或者,如果可能的话,如何在不使用表头的情况下使用rowspan <table border="1"> <tr> <th rowspan="2">Telephone:</th> <td>555 77 854</td> </tr> <

我需要为我的表使用行跨度,因此我(相信)我必须使用表头。但是,使用表头会使我的字体变粗,这是不需要的。对于这个HTML,我如何确保我的表格标题中的字体不是粗体?或者,如果可能的话,如何在不使用表头的情况下使用rowspan

<table border="1">
  <tr>
    <th rowspan="2">Telephone:</th>
<td>555 77 854</td>
  </tr>
  <tr>
    <td>555 77 855</td>
  </tr>
</table>

电话:
555 77 854
555 77 855

只需覆盖CSS中
th
元素的
font-weight

th{
    font-weight: normal;
}
JSBin:



您根本不需要表头,也可以将
rowspan
td
一起使用。要使其不加粗,请将css中的
字体权重
改写为
普通

<table border="1">
  <tr>
    <tr rowspan="2"><p style="font-weight:bold>Telephone:</p></tr>
<td>555 77 854</td>
  </tr>
  <tr>
    <td>555 77 855</td>
  </tr>
</table>