twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.92k stars 78.89k forks source link

Add support for buttons in tables #1062

Closed jkrebs closed 12 years ago

jkrebs commented 12 years ago

It would be great if Bootstrap had built-in support for buttons that fit neatly in table cells, as per-row actions is a pattern we use often.

Currently, using 'form's and 'input's in table cells creates a lot of padding in the table row. Even using the small button classes on an 'a' tag adds a lot of padding.

jkaflik commented 12 years ago

I made this class:

.btn.btn-table {
  padding: 1px 5px 1px;
  font-size: 7px;
  margin-right: -3px;
 }

now include it in your button, works great ;)

ghost commented 12 years ago

I wouldn't write a new class. You can use

table .btn{
  padding: 1px 5px 1px;
  font-size: 7px;
  margin-right: -3px;
}

Instead of table you could use th and/or td.

jkaflik commented 12 years ago

You're right, but I had to use even normal size of button in table

ghost commented 12 years ago

Okay, that makes more sense now. :)

Maybe you could write a more specific selector like

table form .btn

But it depends on your project.

jkaflik commented 12 years ago

My thought is to make new class for it

2012/1/20 Daniel Mies reply@reply.github.com:

Okay, that makes more sense now. :)

Maybe you could write a more specific selector like

   table form .btn

But it depends on your project.


Reply to this email directly or view it on GitHub: https://github.com/twitter/bootstrap/issues/1062#issuecomment-3580441

Jakub Kaflik http://kofel.pl/ 883-348-624

fat commented 12 years ago

I think it looks fine http://cl.ly/DZIP - if you would like less padding you override it as suggested here - thanks!

jkrebs commented 12 years ago

I agree link styles work as expected -- I think the issue is more about forms in table cells. This is the result when using a form input in a table: