I have a CheckBoxList, with RepeatDirection set as "Horizontal" and RepeatLayout set as "Flow". I'm finding that the label and input (checkbox) don't stay together at the end of a line. So I end up with the checkbox on the previous line and the label on the next line, which isn't good.
I'm adding items to the CheckBoxList in the Page_Load code:
I'm aware that it would be possible to keep the checkbox and label together if I could add <nobr> tags around them, but I can't find a way to do that. The HTML code generated just has <input> and <label> tags repeating. So I can't even apply a CSS alternative to <nobr>, which I read would be "white-space:nowrap".
Any ideas how I can keep each checkbox and label pair together, and prevent them from separating over 2 lines?
I'm adding items to the CheckBoxList in the Page_Load code:
Code:
Checkboxlist1.Items.Add(arr(i).ToString)
I'm aware that it would be possible to keep the checkbox and label together if I could add <nobr> tags around them, but I can't find a way to do that. The HTML code generated just has <input> and <label> tags repeating. So I can't even apply a CSS alternative to <nobr>, which I read would be "white-space:nowrap".
Any ideas how I can keep each checkbox and label pair together, and prevent them from separating over 2 lines?