I have an edit form which .form-horizontal
and .control-label
. However, now I want to display one record to the user (for example, details of a users profile). So I envision something like this:
First Name: Foo Last Name: Bar Job: Something
What is the best way to do this using bootstrap framework? I wanted to use the same structure as my edit form but since I'll be showing data, I can't used the .form-horizontal
class. If I use the <table>
tag then what class could I use?
Fast forward to nearly a decade later. With the rise of JavaScript front-end frameworks and an ever-changing landscape of technology and tools, a lot of folks are out there asking if Bootstrap is still relevant in 2021. The short answer is yes.
Simply put, Bootstrap is a massive collection of reusable and versatile pieces of code which are written in CSS, HTML and JavaScript. Since it is also a framework, all the foundations are already laid for responsive web development, and all developers have to do is insert the code into the pre-defined grid system.
Bootstrap will not do everything for you, but it provides a set of reasonable defaults to choose from and it will help developers to concentrate more on the development work than worrying about design, and help them to get a good looking website up and running quickly.
Creating page layouts needs a good grid. Bootstrap has this benefit: one of the best responsive, mobile grid system. It's really easy to use and if you need to work through columns, then you're in the right place using Bootstrap. Very handy when you want to hide some content based on screen size.
Bootstrap 3 provides a 'Horizontal Description' class to do present data exactly like you wish.
http://getbootstrap.com/css/#horizontal-description
With your example data, you would do something like this:
<dl class="dl-horizontal"> <dt>First Name</dt> <dd>Foo</dd> <dt>Last Name</dt> <dd>Bar</dd> <dt>Job</dt> <dd>Something</dd> </dl>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With