There's a first table row that looks like this:
....
<tr>
<th colspan="2">Add a category</th>
</tr>
...
It renders correctly. However I want it to be without colspan attribute, but styled in CSS instead. And the reason for that is because there are a lot of similar tables, so it wouldn't require to define the attribute over and over again (just adhering to DRY principle)
I just want it to be as:
<tr>
<th>Add a category</th>
</tr>
// CSS
table th:first-child {
/* Pseudo attr */
colspan : 2px;
}
I've tried playing with float, padding and width with no success. Is there any way to do that in pure CSS?
As far as I know, there's no way to do that with pure CSS because colspan is really more layout than style.
According to this, It appears that it was supported on some past browsers, but seems to really be not recommended and unsupported in the present day.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With