Search the Community
Showing results for tags 'horizontal'.
-
Hi, here is some code for my site, where images are displayed with text underneath. It is set up in a table, but all the images and text go horizontally, and I need it to go vertically. Please help. <center> <table border="1" rules="cols" width="100%"> <tr> <? foreach($top_ratings as $key => $image) : ?> <td valign="top"><img src="http://mywebsite.com/images/<?=$image->filename?>" width="100%"/></td> <? endforeach ?> </tr> <tr> <? foreach($top_ratings as $key => $image) : ?> <td valign="top">Score: <?=$image->score?></td> <? endforeach ?> </tr> <tr> <? foreach($top_ratings as $key => $image) : ?> <td valign="top">Performance: <?=$image->performance?></td> <? endforeach ?> </tr> <tr> <? foreach($top_ratings as $key => $image) : ?> <td valign="top">Won: <?=$image->wins?></td> <? endforeach ?> </tr> <tr> <? foreach($top_ratings as $key => $image) : ?> <td valign="top">Lost: <?=$image->losses?></td> <? endforeach ?> </tr> </table> </center>
-
I have this code: <?php // template.php code function horizontal_login_block($form) { $form['#action'] = url($_GET['q'], array('query' => drupal_get_destination())); $form['#id'] = 'horizontal-login-block'; $form['#validate'] = user_login_default_validators(); $form['#submit'][] = 'user_login_submit'; $form['#prefix'] = ''; $form['#suffix'] = ''; $form['name'] = array ( '#type' => 'textfield', '#prefix' => '', '#suffix' => '', '#maxlength' => USERNAME_MAX_LENGTH, '#size' => 15, '#required' => TRUE, '#default_value' => 'Username', '#attributes' => array('onblur' => "if (this.value == '') {this.value = 'Username';}", 'onfocus' => "if (this.value == 'Username') {this.value = '';}" ), ); $form['pass'] = array ( '#type' => 'password', '#maxlength' => 60, '#size' => 15, '#required' => TRUE, '#prefix' => '', '#suffix' => '', ); $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array('#type' => 'submit', '#value' => 'Login'); return $form; } ?> Right now the Username and Password and Login button are vertical but I want to make them horizontal. Any idea how to accomplish this? I have this calling it to the page: <?php print login_bar(); function login_bar() { global $user; if ($user->uid == 0) { $form = drupal_get_form('horizontal_login_block'); // Drupal 7 uses a new function 'render'. return render($form); } else { return t('Welcome back ') . ucwords($user->name); } } ?>