I want to do some things with my table but I think an image would sum it up as my english is not the best.
I want to first move the second button to the left. Just one button on each corner on top of my table.
And secondly I want to avoid my input textbox (or a button later) to resieze the whole row of the 2nd header.
Any help will do. I can't figure it out by myself.
Code
#Html.ActionLink("Reset filters", "Index",
null,
new { #class = "btn btn-success custom", #style = "color:white", #role = "button" }
)
<button class="btn btn-default custom" type="submit"><i class="glyphicon glyphicon-file"></i> Export to Excel</button>
<div style="padding-top: 12px"></div>
#using (Html.BeginForm("Index", "Materials", FormMethod.Get))
{
<div id="grid-list">
#{ Html.RenderPartial("_AjaxMaterialList", Model); }
</div>
}
Partial View Code
#using PagedList.Mvc <!--import this so we get our HTML Helper-->
#model IPagedList<eContentMVC.Models.Material>
<!-- import the included stylesheet for some (very basic) default styling -->
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
#*<div style="padding-top: 14px"></div>*#
<div class="panel panel-primary filterable" style="padding: 0px;
margin: 0px">
<div class="panel-heading">
<h3 class="panel-title">GDS eContent Master Data Service Tool</h3>
</div>
<table class="table table-bordered table-hover" style="width:100%">
<thead>
<tr>
<th class="centerAlign" style="width:14%">Brand</th>
<th class="centerAlign" style="width:25%">Category</th>
<th class="centerAlign" style="width:13%">Language</th>
<th class="centerAlign" style="width:7%">BCO</th>
<th class="centerAlign" style="width:9%">Material Cod</th>
<th class="centerAlign" style="width:7%">Derivation</th>
<th class="centerAlign" style="width:7%">Artwork</th>
<th class="centerAlign" style="width:7%">Delivery</th>
<th class="centerAlign" style="width:5%">Export</th>
</tr>
<tr>
<th class="centerAlign" style="height:4%"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
<th class="centerAlign"><input type="text" /></th>
</tr>
</thead>
<tbody>
// Content
</tbody>
</table>
</div>
<div class="centerAlign" style="padding: 0px; margin: -8px">
<!-- output a paging control that lets the user navigation to the previous page, next page, etc -->
#Html.PagedListPager(Model, page => Url.Action("Index", "Materials", new
{
brand_name = Request["brand_name"],
page
}))
</div>
This is the code for making the table looking the right way. For the button, use bootstrap's pull-right.
* {
box-sizing:border-box;
}
.mytable tr th{
height:42px;
}
.mytable input{
width:100%;
}
.mytable th:nth-of-type(1){
width:14%;
}
.mytable th:nth-of-type(2){
width:25%;
}
.mytable th:nth-of-type(3){
width:13%;
}
.mytable th:nth-of-type(4),.mytable th:nth-of-type(6),.mytable th:nth-of-type(7),.mytable th:nth-of-type(8){
width:7%;
}
.mytable th:nth-of-type(5){
width:9%;
}
.mytable th:nth-of-type(9){
width:5%;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<div class="panel panel-primary filterable">
<div class="panel-heading">
<h3 class="panel-title">GDS eContent Master Data Service Tool</h3>
</div>
<table class="table table-bordered table-hover mytable">
<thead>
<tr>
<th class="centerAlign">Brand</th>
<th class="centerAlign">Category</th>
<th class="centerAlign">Language</th>
<th class="centerAlign">BCO</th>
<th class="centerAlign">Material Cod</th>
<th class="centerAlign">Derivation</th>
<th class="centerAlign">Artwork</th>
<th class="centerAlign">Delivery</th>
<th class="centerAlign">Export</th>
</tr>
<tr>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
<th class="centerAlign">
<input type="text" />
</th>
</tr>
</thead>
</table>
</div>
<div class="centerAlign" style="padding: 0px; margin: -8px"></div>
If it helps, +1.
Without the real page i'm not sure, but:
To move the button on the right use bootstrap class pull-right.
To have every row at the same height. I think td have some padding inside. Put padding to 0 and fix the height in css
.table td {
height: 30px;
vertical-align: middle;
}
Or something like this
Related
My HTML table is getting more time to load when the row count is large. I have to load almost 50000 row table to the webpage. I just used basic HTML table. ASP.NET C#.
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Available Resistors In Stock</h3>
<!--
<input type="text" class="form-control pull-right" id="task-table-filter" data-action="filter" data-filters="#task-table" placeholder="Filter Resistors" />
-->
</div>
<table class="table table-hover" id="task-table">
<thead>
<tr>
<th class="center">#</th>
<th class="center">Resistor Type</th>
<th class="center">Resistor Value</th>
<th class="center">Ohm</th>
<th class="center">Location</th>
<th class="center">PL</th>
<th class="center">Place</th>
<th class="center">Category</th>
<th class="center">Quantity</th>
<th class="center">Part NO</th>
<th class="center">Description</th>
<th class="center">Active</th>
<th class="center">Edit</th>
</tr>
</thead>
<tbody>
#for (int i = 0; i < Model.Rows.Count; i++)
{
<tr class="center">
<td>#Model.Rows[i][0]</td>
<td>#Model.Rows[i][1]</td>
<td>#Model.Rows[i][2]</td>
<td>#Model.Rows[i][3]</td>
<td>#Model.Rows[i][4]</td>
<td>#Model.Rows[i][5]</td>
<td>#Model.Rows[i][6]</td>
<td>#Model.Rows[i][7]</td>
<td>#Model.Rows[i][8]</td>
<td>#Model.Rows[i][9]</td>
<td>#Model.Rows[i][10]</td>
<td>#Model.Rows[i][11]</td>
<td>
<a href="#Url.Action("StoreAddResistors", "Store",new {#id=#Model.Rows[i][0] } )">
<span class="glyphicon glyphicon-refresh"></span>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
Is there any way to reduce the loading time of the webpage?
try to split the page into several. Or is it possible to somehow connect several html documents to 1 page? I have no more idea
I'm working on a project where I need to change existing Boostrap2 table responsive. I made a fiddle
<table class="table head center">
<caption></caption>
<tr>
<th scope="col">Member</th>
<th scope="col">Date</th>
<th scope="col">Usage</th>
<th scope="col">Native</th>
<th scope="col">Coverage</th>
<th scope="col"></th>
</tr>
<tr id="members-repeat-container" ng-repeat="">
<td>You</td>
</tr>
</table>
This is all there is to it. A wrapper:
#media screen and (max-width: 767px) {
.responsive-table {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
}
}
#media screen and (max-width: 767px) {
.responsive-table {
width: 100%;
margin-bottom: 15px;
overflow-y: hidden;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" />
<div class="responsive-table">
<table class="table head center">
<caption></caption>
<tr>
<th scope="col">Member</th>
<th scope="col">Date</th>
<th scope="col">Usage</th>
<th scope="col">Native</th>
<th scope="col">Coverage</th>
<th scope="col"></th>
</tr>
<tr id="members-repeat-container" ng-repeat="">
<td>You</td>
<td>
<input name='age' class="member-birthday input-small" ng-class="member.preloaded" type="text" name="birthdate##$index + 1##" id="birthdate##$index+1##" placeholder="mm/dd/yyyy" ui-mask="99/99/9999" ui-mask-use-viewvalue="true" ng-model="member.birthday" date-check mtype="##member.type##" order="##$index##" popover="##member.errorMsg##" trigger-click="##member.errorMsg##" popover-trigger="blur" popover-placement="right" required test-check="##$index##">
</td>
<td>
<label for="tobacco## member.id ##" class="aria-hidden hide">Usage
</label>
<input class="tobacco-input" type="checkbox" name="tobacco## member.id ##" id="tobacco## member.id ##" ng-disabled="member.disableTobacco" />
</td>
<td>
<label for="nativeAmerican## member.id ##" class="aria-hidden hide"> Native
</label>
<input class="coverage-input" type="checkbox" name="nativeAmerican## member.id ##" id="nativeAmerican## member.id ##" ng-model="member.nativeAmerican"/>
</td>
<td>
<label for="coverage## member.id ##" class="aria-hidden hide">
Coverage
</label>
<input class="coverage-input" type="checkbox" name="coverage## member.id ##" id="coverage## member.id ##" ng-model="member.seekingCoverage" ng-click="seekCoverage($index)"/>
</td>
<td class="removebtn">
<a href="javascript:void(0);" ng-show="member.removable" ng-click="remove($index, member.type)" class="btn btn-mini">
<spring:message code="label.iex.prescreen.remove" javaScriptEscape="true"/>
</a>
</td>
</tr>
</table>
</div>
I changed the structure and added some grid classes from Bootstrap3. I got the expected result
Ok I was trying to do a table with input fields. To set the sizes of each field I understood that I had to set the col-size in the header.
<thead>
<tr>
<th class="col-sm-2">Large</th>
<th class="col-sm-2">Large</th>
<th class="col-sm-1">Small</th>
<th class="col-sm-2">Large</th>
<th class="col-sm-1">Small</th>
<th class="col-sm-2">Large</th>
<th class="col-sm-2">Large</th>
</tr>
</thead>
However the inputs expand to their max width with no regard to col-size.
http://jsfiddle.net/m79HR/
Possibly this is an improper use of Bootstrap but I saw it as a best bet for inline inputs with headers above.
Also, lets say I want this particular grid to have 18 columns instead of the default 12 is that possible here just in this particular case?
Just add the "form-control" class to the inputs and bootstrap takes care of the rest.
Doing it this way makes it easier to add columns or change the width, since you only have to change in the header as opposed to every row/input.
<table class="table table-condensed">
<thead>
<tr>
<th class="col-sm-12 col-md-4">Large</th>
<th class="col-sm-12 col-md-2">Small</th>
<th class="col-sm-12 col-md-2">Small</th>
<th class="col-sm-12 col-md-2">Small</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="text" class="form-control" />
</td>
<td>
<input type="text" class="form-control" />
</td>
<td>
<input type="text" class="form-control" />
</td>
<td>
<input type="text" class="form-control" />
</td>
</tr>
</tbody>
</table>
You need to use the class col-md-* for normal screens col-sm-* for tablet screen and col-xs-* for mobile screen, there is also col-lg-* for larger screens, you can combine all these classes to make it responsive, like:
<div class="row">
<div class="col-sm-12">
<table class="table table-bordered">
<thead>
<tr>
<th>Very Small</th>
<th>Very Small</th>
<th>Very Small</th>
<th>Large</th>
<th>Small</th>
<th>Medium</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-sm-1">
<input class="col-sm-12" placeholder="col-sm-1" />
</td>
<td class="col-sm-1">
<input class="col-sm-12" placeholder="col-sm-1" />
</td>
<td class="col-sm-1">
<input class="col-sm-12" placeholder="col-sm-1" />
</td>
<td class="col-sm-4">
<input class="col-sm-12" placeholder="col-sm-4" />
</td>
<td class="col-sm-2">
<input class="col-sm-12" placeholder="col-sm-2" />
</td>
<td class="col-sm-3">
<input class="col-sm-12" placeholder="col-sm-3" />
</td>
</tr>
</tbody>
</table>
</div>
</div>
For Bootstrap 4, you need to additionally add the d-flex class to the rows, like
<table>
<thead>
<tr class="d-flex">
<th class="col-3">3 columns wide header</th>
<th class="col-sm-5">5 columns wide header</th>
<th class="col-sm-4">4 columns wide header</th>
</tr>
</thead>
<tbody>
<tr class="d-flex">
<td class="col-3">3 columns wide content</th>
<td class="col-sm-5">5 columns wide content</th>
<td class="col-sm-4">4 columns wide content</th>
</tr>
</tbody>
</table>
HTML
<table class="table " >
<thead >
<tr>
<th>
Product
</th>
<th>
Price
</th>
</tr>
</thead>
<tbody >
<tr>
<td >
torch
</td>
<td>
<input type="text" class="form-control" id="amountC" name="amountC" autocomplete='off' style="outline: none;
border:none !important;
box-shadow:none !important;">
</td>
</tr>
</tbody>
<thead>
<tr>
<th>
<input type="text" style="float:left" name="" id="couo" placeholder="hi" class="form-control" />
</th>
<th>
<div>
<input type="button" style="padding:5px 12px" name="btnC" id="btnC" class='btn btn-info' value="coupon" />
</div>
</th>
</tr>
<tr>
<th>
Amount to be paid
</th>
<th>
<input type="text" class="form-control" id="amountT" name="amountT" autocomplete='off' style="outline: none;
border:none !important;
box-shadow:none !important;"> </th>
</tr>
</thead>
</table>
I have this HTML in which there are borders in this table.I want to completely remove all the borders inside the table.I tried editing the css.But I cant do that..
here is the fiddle
did u tried this
<style>
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
border: none!important;
}
</style>
this must help you
check this http://jsfiddle.net/spk063/Gz49L/4/
I am trying to layout a JavaScript Web Map using dojo components and would like to add splitters to my dojo Content Panes. I have the one between my left pane and center pane working but am unable to get the one between my center pane and footer to appear. The code below is the Content Pane footer I am trying to add a splitter to. I am sure I am missing something simple, does anyone have any advice?
Thanks in advance!!
<div data-dojo-type="dojox.layout.ContentPane" splitter="true" region="bottom" id="footerAll" style="height:60%; width:100%">
<div id="footerDocNum" class="roundedCorners" dojotype="dojox.layout.ContentPane" region="bottom" style="height:90%; width:96%;display:none;">
<table dojotype="dojox.grid.DataGrid" data-dojo-id="grid1" id="grid1" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<thead>
<tr>
<th field='DOCUMENT_N' width='150px'>Document Number</th>
<th field='SURVEYOR' width='150px'>Surveyor</th>
<th field='TOWNSHIP_R' width='150px'>Township/Range</th>
<th field='SECTION' width='100px'>Section</th>
<th fields="page_id" formatter="makeLink3"width="100px" >
PDF
</th>
</thead>
</table>
</div>
<div id="footerCity" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="bottom" style="height:90%; width:96%; display:none">
<table dojotype="dojox.grid.DataGrid" data-dojo-id="grid2" id="grid2" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<thead>
<tr>
<th field="CITY" width="200px" >
City
</th>
<th field="Square_Mil" width="150px" >
Square Miles
</th>
</tr>
</thead>
</table>
</div>
<div id="footerPoints" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="bottom" style="height:90%; width:96%; display:none;">
<table dojotype="dojox.grid.DataGrid" data-dojo-id="grid4" id="grid4" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<td> <tr>
<form name="griddataControl" id="gridDataFormControl" action="resultsControl.cfm" target="_blank" method="post" style="display:none"><input id="gridDataTextControl" name="gridDataTextControl" type="hidden"><input type="hidden"></form>
<button dojoType="dijit.form.Button" value="Export Results" onclick="document.forms['gridDataFormControl'].submit();">Export To Excel</button><b>Monument Results</b></tr></td>
<thead>
<tr>
<th field="POINT_NAME" width="150px" >
Point Name
</th>
<th field="GRID_ADDRE" width="150px" >
Address
</th>
<th field='TOWNSHIP_R' width='150px'>Township/Range</th>
<th field="SECTION" width="100px" >
Section
</th>
<th fields="POINT_NAME,LONGITUDE,LATITUDE" formatter="makeLink1" width="150px" >
Mon. Ref. Sheet
</th>
<th field="MON_NOTES" width="150px" >
Monument Notes
</th>
</tr>
</thead>
</table>
</div>
<div id="footersurvName" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="bottom" style="height:90%; width:96%; display:none;">
<table dojotype="dojox.grid.DataGrid" data-dojo-id="grid5" id="grid5" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<form name="griddata" id="gridDataForm" action="results.cfm" target="_blank" method="post" style="display:none"><input id="gridDataText" name="gridDataText" type="hidden"><input type="hidden"></form>
<tr><button dojoType="dijit.form.Button" value="Export Results" onclick="document.forms['gridDataForm'].submit();">Export To Excel</button><b>Survey Results</b></tr>
<thead>
<tr>
<th field="page_description" width="150px" >
Survey Number
</th>
<th field="SURVEYOR" width="150px" >
Surveyor
</th>
<th field="ADDRESS_OF_SURVEY" width="200px" >
Address
</th>
<th field='TOWNSHIP_RANGE' width='150px'>
Township/Range
</th>
<th field="SECTION" width="100px" >
Section
</th>
<th fields="subdir,page_id" formatter="makeLink" width="75px" >
PDF
</th>
</tr>
</thead>
</table>
</div>
<div id="footerSection" class="roundedCorners" dojotype="dijit.layout.ContentPane" region="bottom" style=" height:90%; width:96%; display:none;">
<table dojotype="dojox.grid.DataGrid" data-dojo-id="grid7" id="grid7" data-dojo-props="rowsPerPage:'5', rowSelector:'20px'">
<thead>
<tr>
<th field='TOWN_RANGE' width='150px'>
Township/Range</th>
<th field="Section_Nu" width="150px" >
Section
</th>
</tr>
</thead>
</table>
</div>
</div>