0

I have this code and it outputs buttons that goes down. I want them to go horizontally. please help. T_T

<?php

    $var=1;
    while($row=mysql_fetch_array($che… {
    ?>

    < action='' method='post'>
    <input type='submit' name='view' value="<?php echo @$var ?>"/>
    <input name="workId" type="hidden" value="<?php echo $row['workId']; ?>" />
    </form>  

<?php $var++; } ?>

I don't want to put it inside table and loop it as a <td>
i just want it to loop and follow the size of the container. :(
if i put the <form></form> outside the loop, only the last value would be stored on the values of the buttons :(

call me a noob or whatever. all I want is to learn. T_T

3
Contributors
3
Replies
17
Views
4 Years
Discussion Span
Last Post by ses03
0

Make your input's float left with CSS and they will automatically fill your container horizontally (if that's what you mean).

0

Try this out for your buttons

.button-box {
    float:left;
    margin-right:20px;
    margin-bottom:10px;
}



<div class="button-box">
<input type="submit" name="" value="" />
<input type="hidden" name="" value="" />
</div>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.