Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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代码 <table> <tbody> <tr> <td class="bedButton ward-A">A115:1</td> <td class="bedButton ward-A">A116:1</td> </tr> </tbody> </table> 要使文本水平居

请看下图

如何使图像在表格中居中(
)?填充不在顶部留出空间,仅在右侧和底部留出空间

下面是表格html代码

<table>
<tbody>
<tr>
<td class="bedButton ward-A">A115:1</td>
<td class="bedButton ward-A">A116:1</td>
</tr>
</tbody>
</table>

要使文本水平居中,请使用:

td {
    text-align:center;
}

<强>

你是指在TD的中间对齐文本??文本对齐,垂直居中对齐?不,我的意思是在=)的中心对齐背景图像。哦,你可能想编辑这个问题来明确你想做什么。背景位置:中心;可能会这样请包含背景图像的绝对URL,因为我们看不到背景。background.position完成了,谢谢:)背景图像怎么样?背景:url(../images/bedview/bed background.png)无重复;?=)在背景的位置部分设置

50%50%
,如
background:url('http://www.placekitten.com/250/300“)不重复50%50%。看见
td {
    text-align:center;
}