网页设计中有时候会使用到table这个标签来在网页中插入表格,那么,在table中怎样设置td的宽度呢?td指的就是单元格,下面小编来讲解。
<tr> <td width="13%" style="text-align: center;"><strong>30% Off </strong></td>
</tr>
上面是对 表格单元格字体
单元格行占比13%宽度
文字居中显示
加粗显示。
对于文字进行 字体设置 如何设置呢?
答案如下:
<tr> <td width="13%" style="text-align: center; font-size:40px"><strong>30% Off </strong></td>
在 style 中去加 font-size: 字体属性 就可以了。
代码和效果如下:
<table class="jbEidtTable" border="1" cellspacing="0" cellpadding="5" style="border-color: rgb(229, 230, 233); width:1000px; border-collapse: collapse;">
<tbody>
<tr> <td width="13%" style="text-align: center;"><strong>Discount</strong></td>
<td width="25%" style="text-align: center;"><strong>CouponCode</strong></td>
<td width="25%" style="text-align: center;"><strong>Pic</strong></td>
<td width="25%" style="text-align: center;"><strong>Product Info & Link</strong></td>
</tr>
<tr> <td width="13%" style="text-align: center; font-size:40px"><strong>30% Off </strong></td>
</tr>
效果: