Hi I have a table where certain columns in a row are connected with the colspan="2"
attribute.
In the moment it looks like this:
I want that the text of the connected columns in a row is centered, but only the text in the connected columns
The table data of this row (unlimited ) has the following code
<tr class="row-4 even">
<td colspan="2" class="column-3 footable-last-column" style="display: table-cell;">unlimited</td>
</tr>
I can not change the code of the table because it is automatically created by the WordPress plugin tablepress
What I can do is to add a custom .css file.
My Question is, if it is possible to select only the table data with the attribute
colspan="2"
with .css, so that I can do { text-align: center }
only for table data with the attribute colspan="2"
The CSS selector
[attribute="value"]
is what you want, so you should addto center the cell that spans two columns.
If you want to center cells that span any number of columns, you can use
to select all cells that have a
colspan
attribute set to a value other than1
.This should do the trick if you are applying the CSS inline: