I am trying to improve my understanding of CSS.
I have the following HTML table:
<div class="app-pages validate-email-page" id="containerbg2">
<div>
<form action="<?php echo site_url("/validation-control");?>" method="post" id="dataForm">
<table border='1' class="email-table">
<tr>
<th>First Name</th>
<th>Surname</th>
<th>Email</th>
<th>Sign Up Date</th>
<th>Expiration Date</th>
<th>Roll back user?</th>
<th>Repeat Validation?</th>
</tr>
<?php
$wcl_ci_api->get_page_view_verification_emails();
?>
</table>
<input type="submit" value="Confirm">
</form>
</div>
</div>
</div>
I have the following CSS:
div.validate-email-page table {
text-align: left;
}
From what I understand of the CSS above:
It is saying that any 'table' within a 'div' with the 'class validate-email-page'
Will have the CSS styling applied to it eg all text will be aligned left.
Next, if I want to apply specific styling to parts of the table eg head I can do the following:
div.validate-email-page table th{
text-align: left;
}
div.validate-email-page table tr{
text-align: center;
}
And these 2 say:
Center text (Left text) for all rows (headers) in a table within a div with the class 'validate-email-page'
This all seems to be working fine.
My problem is, I want to only centre the checkboxes, which are made by the php and have the class 'checkradio' and type 'checkbox',but so far all my attempts have failed.
I have tried lots of different variations, but cannot seem to get it right eg:
div.validate-email-page table input checkbox{
text-align: Center;
}
I know I am not too far but I cannot work it out and cannot seem to find a clear answer to my problem
Preferably I would like to style by column name, so I can change the style of each column based on the column name.