center text of table data connected with colspan="2" with .css " Select td with attribute colspan="2" "
The CSS selector [attribute="value"]
is what you want, so you should add
td[colspan="2"] { text-align: center;}
to center the cell that spans two columns.
If you want to center cells that span any number of columns, you can use
td[colspan]:not([colspan="1"]) { text-align: center;}
to select all cells that have a colspan
attribute set to a value other than 1
.
This should do the trick if you are applying the CSS inline:
<td colspan="2" style="text-align:center;">unlimited</td>