I have a PHP code
<?php $j = 0; foreach($v->valeur as $valeur) { ?>
<input type="checkbox"
class=" "
name="check<?php echo $v->id; ?>[]"
value="<?php echo $j; ?>"
<?php if(strpos($v->active,','.$j.',')!==false) echo ' checked'; ?>
data-labelauty="<?php echo $valeur; ?>" />
<?php echo $valeur.str_repeat(' ', 2); ?>
<?php ++$j; ?>[![enter image description here][1]][1]
<?php } ?>
where
echo $valeur.str_repeat(' ', 2);
generates " Djembe ".
My problem is that I want the checkbox and the text to be on THE SAME LINE reagardless of screen width.
See some code and desirde output
3
Answers
OK, solved it like this:
To keep the checkbox and text on one line, you can use the CSS property "display: inline-block;" on the checkbox and text elements. This will ensure that both elements remain on the same line, regardless of the screen width. For example:
You have to warp the input and text in tag like label or div and give that tag property
display: inline-block;
check: https://jsfiddle.net/2tg54uzj/