Does a tag for grouping th
or td
elements exist?
I need something like this:
相关标签:
-
2021-01-24 02:51
Does exists a tag for grouping th or td element?
Yes, it's called colgroup.
Don't want to use a colgroup? Sorry, that's how grouping table columns is done in HTML. Use the tools given to you, or don't.
-
2021-01-24 03:08
for grouping cols (or rows ) in a html table you can use colspan (or rowspan) attribute
<table>
<caption>Test Caption </caption>
<tr> <th colspan="2">65</th>
<th colspan="2">40</th>
<th colspan="2">20</th>
</tr>
<tr>
<th>Men</th>
<th>Women</th>
<th>Men</th>
<th>Women</th>
<th>Men</th>
<th>Women</th>
</tr>
<tr>
<td>82</td>
<td>85</td>
<td>78</td>
<td>82</td>
<td>77</td>
<td>81</td>
</tr>
</table>
(or nested table)