I am trying to format my check boxes within a form using table display and CSS styling. Here is the code I have implemented:
form {
display: table;
}
div.tableRow {
display: table-row;
}
Div.tableRow p {
display: table-cell;
vertical-align: top;
padding: 3px;
}
div.tableRow p:first-child {
text-align: left;
}
h1 {
font-weight: bold;
font-size: 16px;
}
<form action="" method="POST>
<div class="tableRow">
<p>Address: <input type="text" name="Address"></p><br></div>
<div class="tableRow"><p>
Phone: <input type="tel" name="Phone">
</p></div>
<div class="tableRow">
<p>
<select name="size">
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="X-Large">X-Large</option>
</select></p></div>
<div class="tableRow">
<p>Crust:
<input type="radio" name="crust" value="Thin"> Thin <br>
<input type="radio" name="crust" value="Regular"> Regular
</p></div>
<div class="tableRow">
<p> Toppings:
<input type="checkbox" name="toppings" value="Pepperoni"> Pepperoni<br>
<input type="checkbox" name="toppings" value="Beef"> Beef <br>
<input type="checkbox" name="toppings" value="Italian Sausage"> Italian Sausage <br>
<input type="checkbox" name="toppings" value="Green Peppers"> Green Peppers <br>
<input type="checkbox" name="toppings" value="Onions"> Onions <br>
<input type="checkbox" name="toppings" value="Mushrooms"> Mushrooms <br>
<input type="checkbox" name="toppings" value="Banana Peppers"> Banana Peppers <br>
<input type="checkbox" name="toppings" value="Jalapenos"> Jalapenos <br>
<input type="checkbox" name="toppings" value="Black Olives"> Black Olives <br>
</p></div>
<div class="tableRow">
<p> Extras:
<input type="checkbox" name="extras" value="Drink"> Drink <br>
<input type="checkbox" name="extras" value="Breadsticks"> Breadsticks <br>
<input type="checkbox" name="extras" value="Cheesesticks"> Cheesesticks <br>
</p></div>
<div class="tableRow">
<p>
<input type="submit" value="Place Order">
</p></div>
</form>
This is how it looks:
https://i.sstatic.net/qbHdt.png