Aligning Buttons with rails code, css, and html -


i have 2 buttons in form, using css sheet layout tables , want have buttons in last row, want them side side.

my current code looks

<button><%= link_to "edit", edit_user_path(u.id), { :method =>get } %></button> <button><%= link_to "delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'are sure?' } %></button> 

enter image description here

if change to:

<button><%= button_to "edit", edit_user_path(u.id), { :method =>get } %></button> <button><%= button_to "delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'are sure?' } %></button> 

enter image description here

the buttons end side side, button button tag. if change to:

<td><%= button_to "edit", edit_user_path(u.id), { :method =>get } %> <%= button_to "delete", user_path(u.id), { :method => delete, :class=>destroy, data: {confirm: 'are sure?' } %></td> 

enter image description here

the buttons in same row, horizontally alligned.

is there way correctly display in center of column both buttons? perhaps add in css tells button call instead?

wrap buttons in div so: https://jsfiddle.net/5th07vq6/

html:

 <div class="center">      <button>edit</button>      <button>delete</button>  </div> 

css:

.center {      width: 50%;      margin: 0 auto; } 

Comments

Popular posts from this blog

php - Wordpress: Link a post to posts of another category manually -

javascript - Complete OpenIDConnect auth when requesting via Ajax -

apache - PHP Soap issue while content length is larger -