Ashley P.

asked • 11/14/19

HTML Checkboxes

How do we create a checkbox of the following format in HTML?


Colors (checkbox icon) red

(checkbox icon) green

(checkbox icon) red



I could only do it as folows :


Colors (checkbox icon) red

(checkbox icon) green

(checkbox icon) red


1 Expert Answer

By:

Suzanne O. answered • 11/14/19

Tutor
4.5 (19)

International Experience and Multiple State Certifications

Ashley P.

Hi, thanks for the response.I'm looking for the simplest way to do this using a single form
Report

11/14/19

Suzanne O.

You are welcome. If you want to use a single form, you can move the ... tags outside of the ... tags. Going from 3 .. pairs to one. That's the beauty of html, it will still work. Other than that you will have to try css and/or java attributes and counting pixels in order to align things. Good luck.
Report

11/15/19

Suzanne O.

@#$%& editor! It cut out the "form" tags I wrote in. Move the form tags outside of the table tags, from 3 pairs down to one if you only want a single form.
Report

11/15/19

Ashley P.

Wow, that works!!! And what if we want a border just around the form, not in like when we add the border attribute within the table tag so it draws borders all around data?
Report

11/16/19

Suzanne O.

That would have to be done in css, not html. You would define the table, and the table and td's would have individual border styles set. You would have to tweak it to see if you could get it to not look boxy
Report

11/16/19

Ashley P.

Can we do it like this using Inline style sheet? But I didn't get the border
Report

11/16/19

Suzanne O.

you might have to compromise, but look at the code above
Report

11/17/19

Suzanne O.

oops, sorry " Page Title Colors Red Green Blue "
Report

11/17/19

Suzanne O.

blasted editor is using html so it interprets the tags. Let me replace all<> with **...
Report

11/17/19

Suzanne O.

*form* *table border=1 style="border-collapse:collapse"* *tr**td rowspan=3>Colors*/td**td**input type="checkbox" name="color1" value="Red"* Red*/td**/tr* *tr**td**input type="checkbox" name="color2" value="Green"* Green*/td**/tr* *tr**td**input type="checkbox" name="color3" value="Blue"* Blue*/td**/tr* */table**/form*
Report

11/17/19

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.