jagr12
asked on
Bootstrap - table width
I want to create a table using Bootstrap. How can I set a width of this table? Right now, it stretch across a web page?
<table class="table table-bordered">
<thead>
<tr>
<th>Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
</tr>
</tbody>
</table>
<table class="table table-bordered">
<thead>
<tr>
<th>Header</th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
</tr>
</tbody>
</table>
here's a great link:
http://v4-alpha.getbootstrap.com/content/tables/
http://v4-alpha.getbootstrap.com/content/tables/
Use for example:
<div class="col-md-6">
And you have half the page
<div class="col-md-6">
And you have half the page
ASKER
It is possible to center this able too?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you gentlemen
Alternative to creating empty <div>
http://getbootstrap.com/css/#grid-offsetting
<div class="col-md-6 col-md-offset-3">
<table ....>
</div>
More info on the Bootstrap site http://getbootstrap.com/css/#grid-offsetting
You can adjust based on your needs.