What's new
HTML Forums | An HTML and CSS Coding Community

Welcome to HTMLForums; home of web development discussion! Please sign in or register your free account to get involved. Once registered you will be able to connect with other members, send and receive private messages, reply to topics and create your very own. Our registration process is hassle-free and takes no time at all!

How to center chechbox in Table Cell?

Elina009

New member
Hey Community,

I'm currently struggling with my checkboxes from my table, which i designed with html.
Can anyone help me with positioning the checkbox in the middle of the Table Cell?

Now, the checkbox is on the left side.

This is the code of the "style":

<!DOCTYPE html>

<style>
.hide {
display: none;
}
/* Hide default checkbox */
.container input[type=checkbox]{

position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
/* The container */
.container {
display: block;
position: relative;
padding-left: 35px;
margin-bottom: 12px;
cursor: pointer;
font-size: 22px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

/* customized checkbox */
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 20px;
width: 20px;
background-color: #eee;
border: 2px solid #00b578;
border-radius: 8px;
}
Thank you for your help.
 
Back
Top