I am trying to design the table with 2 rows and 3 columns. In the first row would be Header row with headings of Columns. And in 2nd row 1st column would be Editable Text area and 2nd column and 3rd column would be Dropdown list. I am using HTML table to achieve this. But not able to getting the dropdown option.
This is my code for Table
<div id="MainContent_panelConfigFileContent">
<table class="table">
<tbody>
<tr>
<th>Start Position</th>
<th>Type of Scramble</th>
<th>Scrambling Required</th>
</tr>
</tbody>
</table>
</div>
<form id="form1" runat="server">
<div class="row modalpop-body">
<table>
<thead>
<tr>
<td class="col-md-4">Start Position</td>
<td class="col-md-4">Type of Scramble</td>
<td class="col-md-4">Scrambling Required</td>
</tr>
</thead>
<tbody>
<tr>
<td class="col-md-4"><textarea class="form-control" rows="3" id="comment"></textarea></td>
<td class="col-md-4"><div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</div></td>
<td class="col-md-4"><div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Dropdown Example
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</div></td>
</tr>
</tbody>
</table>
</div>
CSS .modalpop-body {background: brown;margin:30px;font-size:24px;padding: 20px;}
you can check it in check this link
Your question is confusing but are you referring to something like this?
<table>
<thead>
<tr>
<td>Header 1</td>
<td>Header 2</td>
<td>Header 3</td>
</tr>
</thead>
<tbody>
<tr>
<td>Your Editor</td>
<td>Your Dropdown</td>
<td>Your Dropdown</td>
</tr>
</tbody>
</table>
Hope this helps somehow.
Your code is incomplete. Try to give a better code to understand. Thank you
Related
I have a simple Bootstrap 4 page with multiple tabs on the page. Each tab has a different table, some of which have a large number of rows. I would now like to make the table header on each tab fixed/sticky so that it doesn't scroll as the user scrolls the page down.
Here's an example of my page with a table on the first tab:
th {
background: white;
position: sticky;
top: 0;
}
<link href="https://getbootstrap.com/docs/4.0/examples/starter-template/starter-template.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="#"><img src="" width="165" height="36" alt=""></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Management</a>
<div class="dropdown-menu" aria-labelledby="dropdown01">
<a class="dropdown-item" href="jobs.php?action=showall">Jobs List</a>
<a class="dropdown-item" href="jobsSearch.php">Search Jobs</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="logout.php">Logout <span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-md-7">
<table class="table table-striped table-bordered">
<tr>
<td width=35%>Ref Number:</td>
<td width=80%>123456</td>
</tr>
<tr>
<td>Name:</td>
<td>Acme Corp Pty Ltd</td>
</tr>
<tr>
<td>Job Number:</td>
<td>5521236987452</td>
</tr>
<tr>
<td>Address:</td>
<td>21 Jump St, Beverley Hills 90210</td>
</tr>
<tr>
<td>Client:</td>
<td>Sony Pty Ltd</td>
</tr>
<tr>
<td>State:</td>
<td>CA </td>
</tr>
<tr>
<td>Inspection Date:</td>
<td></td>
</tr>
</table>
</div>
</div>
<ul class="nav nav-tabs" id="projectTabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="Contacts-tab" data-toggle="tab" href="#Contacts" role="tab" aria-controls="Contacts" aria-selected="true">Contacts</a>
</li>
<li class="nav-item">
<a class="nav-link" id="Contractors-tab" data-toggle="tab" href="#Contractors" role="tab" aria-controls="Contractors" aria-selected="false">Contractors</a>
</li>
</ul>
<div class="tab-content" id="Tabs">
<div class="tab-pane fade show active" id="Contacts" role="tabpanel" aria-labelledby="Contacts">
<table class="table table-striped table-hover table-bordered">
<thead>
<th scope="col">Name</th>
<th scope="col">Title</th>
<th scope="col">Code</th>
</thead>
<tbody>
<tr id="211140">
<td> Jaxon Copeley</td>
<td>Senior Designer</td>
<td>8</td>
</tr>
<tr id="212265">
<td> Sean Dacey</td>
<td>Associate</td>
<td>1687</td>
</tr>
<tr id="212364">
<td> Nathan Giffen</td>
<td>Senior Designer</td>
<td>273.8</td>
</tr>
<tr id="212312">
<td> Tristan Godson</td>
<td>Project Designer </td>
<td>85.75</td>
</tr>
<tr id="207542">
<td> Anthony McAulay</td>
<td>Designer</td>
<td>566.2</td>
</tr>
<tr id="207990">
<td> Gabriella Schofield</td>
<td>Senior Designer</td>
<td>107</td>
</tr>
<tr id="213479">
<td> Hayden Giblin</td>
<td>Creative Designer</td>
<td>60</td>
</tr>
<tr id="208423">
<td> Archer Doolan</td>
<td>Associate</td>
<td>487.9</td>
</tr>
<tr id="208468">
<td> Taylah Hutcheon</td>
<td>Senior Associate</td>
<td>5</td>
</tr>
<tr id="212645">
<td> Hayley Hodgson</td>
<td>Director</td>
<td>37</td>
</tr>
<tr id="214303">
<td> Henry Powell</td>
<td></td>
<td>9</td>
</tr>
</tbody>
</table>
</div>
Is it possible to have the headers on the tabs fixed so they are visible as you scroll down the page?
You can use the position:sticky property on th elements for this.
If you have an additional fixed element on your page (like a fixed navbar), set the top property to the height of this element, so it sticks to the bottom of it:
th {
background: white;
position: sticky;
top: 60px; /* this is the distance from the top of the viewport your element will 'stick' to. */
}
<link href="https://getbootstrap.com/docs/4.0/examples/starter-template/starter-template.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div class="col-md-7">
<table class="table table-striped table-bordered">
<tr>
<td width=35%>Ref Number:</td>
<td width=80%>123456</td>
</tr>
<tr>
<td>Name:</td>
<td>Acme Corp Pty Ltd</td>
</tr>
<tr>
<td>Job Number:</td>
<td>5521236987452</td>
</tr>
<tr>
<td>Address:</td>
<td>21 Jump St, Beverley Hills 90210</td>
</tr>
<tr>
<td>Client:</td>
<td>Sony Pty Ltd</td>
</tr>
<tr>
<td>State:</td>
<td>CA </td>
</tr>
<tr>
<td>Inspection Date:</td>
<td></td>
</tr>
</table>
</div>
</div>
<ul class="nav nav-tabs" id="projectTabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="Contacts-tab" data-toggle="tab" href="#Contacts" role="tab" aria-controls="Contacts" aria-selected="true">Contacts</a>
</li>
<li class="nav-item">
<a class="nav-link" id="Contractors-tab" data-toggle="tab" href="#Contractors" role="tab" aria-controls="Contractors" aria-selected="false">Contractors</a>
</li>
</ul>
<div class="tab-content" id="Tabs">
<div class="tab-pane fade show active" id="Contacts" role="tabpanel" aria-labelledby="Contacts">
<table class="table table-striped table-hover table-bordered">
<thead>
<th scope="col">Name</th>
<th scope="col">Title</th>
<th scope="col">Code</th>
</thead>
<tbody>
<tr id="211140">
<td> Jaxon Copeley</td>
<td>Senior Designer</td>
<td>8</td>
</tr>
<tr id="212265">
<td> Sean Dacey</td>
<td>Associate</td>
<td>1687</td>
</tr>
<tr id="212364">
<td> Nathan Giffen</td>
<td>Senior Designer</td>
<td>273.8</td>
</tr>
<tr id="212312">
<td> Tristan Godson</td>
<td>Project Designer </td>
<td>85.75</td>
</tr>
<tr id="207542">
<td> Anthony McAulay</td>
<td>Designer</td>
<td>566.2</td>
</tr>
<tr id="207990">
<td> Gabriella Schofield</td>
<td>Senior Designer</td>
<td>107</td>
</tr>
<tr id="213479">
<td> Hayden Giblin</td>
<td>Creative Designer</td>
<td>60</td>
</tr>
<tr id="208423">
<td> Archer Doolan</td>
<td>Associate</td>
<td>487.9</td>
</tr>
<tr id="208468">
<td> Taylah Hutcheon</td>
<td>Senior Associate</td>
<td>5</td>
</tr>
<tr id="212645">
<td> Hayley Hodgson</td>
<td>Director</td>
<td>37</td>
</tr>
<tr id="214303">
<td> Henry Powell</td>
<td></td>
<td>9</td>
</tr>
</tbody>
</table>
</div>
I'm trying to position a Bootstrap styled dropdown button for use with a table. I can get it so the container rows butt up, but then there is a visual gap between the button and the edge of the table. I'm trying to shrink that gap (to maybe 3 px?).
I've messed with absolute and relative positioning, but for some reason my brain just isn't getting it.
I quick put together this fiddle to help shown what I mean: https://jsfiddle.net/rbennett/emup7wpe/1/
<div class="container">
<div class="col-sm-12">
Trying to figure out how to correctly position a button for a table...
<br />
<br />
<div class="button-row">
<button id="itemsButton" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
Items<span class="caret"></span>
</button>
<ul id="itemSelectorDropdown" class="dropdown-menu">
<li>test1</li>
<li>test2</li>
<li>test3</li>
</ul>
</div>
<br />
<div class="other-row">
<table id="testTable" class="table table-bordered" cellspacing="0">
I have elements from a DatatTable table that sit right here<br />so I'm looking to position the "Items" button on the same line,<br />but aligned to the right.
<thead>
<tr>
<th>Data1</th>
<th>Data2</th>
</tr>
</thead>
<tbody>
<tr>
<td>xyz</td>
<td>abc</td>
</tr>
<tr>
<td>qrs</td>
<td>123</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
Can someone nudge me in the right direction on how to position the button so that it is right above the table (and not have a gap)?
I modified your html just a tiny bit. I moved the button just above the table.
I also added 1 rule to move the button.
.other-row {
outline: 1px solid blue;
}
#itemsButton{
float: right;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="col-sm-12">
Trying to figure out how to correclty position a button...
<br />
<br />
<div class="button-row">
<ul id="itemSelectorDropdown" class="dropdown-menu">
<li>test1</li>
<li>test2</li>
<li>test3</li>
</ul>
</div>
<br />
<div class="other-row">
<button id="itemsButton" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Items<span class="caret"></span></button>
<table id="testTable" class="table table-bordered" cellspacing="0">
We want to see the "Items" button here (aligned to the right)
<thead>
<tr>
<th>Data1</th>
<th>Data2</th>
</tr>
</thead>
<tbody>
<tr>
<td>xyz</td>
<td>abc</td>
</tr>
<tr>
<td>qrs</td>
<td>123</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
just change border-radius:0 in your button
#itemsButton
{border-radius:0;float:right;}
.other-row {
outline: 1px solid blue;
}
#itemsButton
{border-radius:0; float:right}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/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.7/js/bootstrap.min.js"></script>
<div class="container">
<div class="col-sm-12">
Trying to figure out how to correclty position a button...
<br />
<br />
<div class="other-row">
<div class="button-row">
<button id="itemsButton" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
Items<span class="caret"></span>
</button>
<ul id="itemSelectorDropdown" class="dropdown-menu">
<li>test1</li>
<li>test2</li>
<li>test3</li>
</ul>
</div>
<table id="testTable" class="table table-bordered" cellspacing="0">
<thead>
<tr>
<th>Data1</th>
<th>Data2</th>
</tr>
</thead>
<tbody>
<tr>
<td>xyz</td>
<td>abc</td>
</tr>
<tr>
<td>qrs</td>
<td>123</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
I am trying to make table in which there are two show/hide buttons for two columns say A and B.. button a and b separately are functioning properly but If i use both in table ... only one of them functions properly other doesn't do anything.. pls hlp me i am new to this
<table datatable="ng" class="row-border hover table table-condensed no-margin">
<thead>
<tr>
<th>#</th>
<th>Username</th>>
<th>Profile</th>
<th>Points</th>
<th>Forcasts Won/Lost</th>
<th>Invites</th>
<th>Referrals</th>
<th>Activity</th>
<th>Most Used Redeemption Gateway</th>
<th>Most Read FAQ</th>
<th>Promo Codes used</th>
<th>Suspend/Unsuspend</th>
</tr>
</thead>
<tbody>
<tr ng-repeat-start="person in showCase.persons">
<td>{{person.id}}</td>
<td>{{person.uname}}</td>
<td>
<button type="button" class="btn btn-primary" ng-if="person.Profexpanded" ng-click="person.Profexpanded = false;person.Invexpanded=false">Hide</button>
<button type="button" class="btn btn-primary" ng-if="!person.Profexpanded" ng-click="person.Profexpanded = true;person.Invexpanded=false">Show</button>
</td>
<td>{{person.points}}</td>
<td>{{person.forcasts}}</td>
<td style="padding:5px">
<table><tbody>
<tr><td><b>sent: </b></td> <td>{{person.invites[0].sent}}</td></tr>
<tr><td><b>accepted:</b></td> <td>{{person.invites[0].accepted}}</td></tr>
</tbody></table>
</td>
<td>{{person.referrals}}</td>
<td>
<button type="button" class="btn btn-primary" ng-if="person.Invexpanded" ng-click="person.Invexpanded = false;person.Profexpanded = false">Hide</button>
<button type="button" class="btn btn-primary" ng-if="!person.Invexpanded" ng-click="person.Invexpanded = true;person.Profexpanded = false">Show</button>
</td>
<td>{{person.muredempt}}</td>
<td>{{person.mfaq}}</td>
<td>{{person.promocodes}}</td>
<td>{{person.isSuspended}}</td>
</tr>
<tr ng-if="person.Profexpanded" ng-repeat-end="">
<td class = "profile" colspan="5">
Hello A
</td>
</tr>
<tr ng-if="person.Invexpanded" ng-repeat-end="">
<td>Hello B</td>
</tr>
</tbody>
</table>
<!--end .card-body -->
</div>`
Maybe try ng-show instead ng-if <tr ng-show="person.Invexpanded" ng-repeat-end="">
Use
<tr ng-if="person.Profexpanded">
instead of
<tr ng-if="person.Profexpanded" ng-repeat-end="">
My web page has a table and for one element i have to apply grid property of foundation. I have to divide the row into two columns having size 10 and 2. First column is an input field and second is a drop down icon, But when I try to do it 2nd column is going down after first column.
<table class="inner-table">
<tr>
<td width="20">plan </td>
<td width="50">Mobile</td>
<td width="15">20%</td>
<td width="15">50%</td>
</tr>
<tr>
<td>dsffgh</td>
<td>Mobile</td>
<td>20%</td>
<td>50%</td>
</tr>
<tr>
<td>Plan</td>
<td>
<div class="row">
<form class="project-name">
<div class="small-11 columns">
<input type="text" name="projectName">
</div>
<div class="small-1 columns">
<a href="#" data-dropdown="drop1"><img src="images/Rectangle-13.png" alt="dropdown-menu" height="10em" width="10em">
</a>
<ul id="drop1" class="f-dropdown" data-dropdown-content>
<li>10</li>
<li>15<li>
<li>20</li>
</ul>
</div>
</form>
</div>
</td>
</tr>
<tr>
<td id="dot-emp3" class="show-more">
...
</td>
</tr>
</table>
http://codepen.io/anon/pen/MaaOxG
I have a table I decorated with bootstrap.
Here is the simple table view (collapsed).
Each table row has two horizontal sets of data. So the expanded view for each row shows up when the "Details" button is clicked. Here's the expanded view.
The first set of data of each row has 4 columns. While I'd like the second set of data of the same row to fully occupy the whole table width.
The problem is that the way I did it doesn't feel the best way to do it.
I pretty much used Angular loop construct to repeat the <tr>. I then embedded two tables per <tr> so that I can display the first data set in the first table and the expanded view in the second table. Clicking on the "Details" button shows the second set (table) of data of row.
<table class="table-hover table-condensed">
<!--<table class="table">-->
<thead>
<tr>
<th align="left" class="span2">Date</th>
<th align="left" class="span2">Title</th>
<th align="left" class="span2">Bill Total</th>
<th align="left" class="span4">Options</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="ibill in user.groups[0].bills | filter:query | orderBy:'date'">
<td colspan="4">
<table>
<tr>
<td class="span2">{{ ibill.billDate | date:'MM/dd/yyyy'}}</td>
<td class="span2">{{ ibill.title }}</td>
<td class="span2">${{ ibill.billTotal }}</td>
<td class="span4">
<!-- <a ng-click='deleteBill(ibill.id)'><i class="icon-trash "></i></a>
<i class="icon-pencil "></i>--> <a ng-click='deleteBill(ibill.id)' class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class=" icon-trash"></i></a>
<i class="icon-edit"></i>
<a class="btn btn-mini" ng-init="ibill.isCollapsed = 'true'" ng-click="ibill.isCollapsed = !ibill.isCollapsed"><i class="icon-eye-open"></i> details</a>
<!--<a class="btn" ng-init="ibill.isCollapsed=' true'" ng-click="ibill.isCollapsed=! ibill.isCollapsed"><i class="icon-folder-open "></i> Details</a>-->
</td>
</tr>
</table>
<table>
<tr>
<td colspan="4">
<div collapse="ibill.isCollapsed">
<div>
<p ng-repeat="simplecost in ibill.billSimpleEntry.simpleUserIdAndLiableCost">{{simplecost.user.fName}} owes ${{simplecost.liableCost}}</p>
</div>
</div>
</td>
</tr>
</table>
</td>
<!--<td>{{ibill}}</td>-->
</tr>
<!-- <tr>
<td><div collapse="ibill.isCollapsed">
<div class="well well-large">Some content</div>
</div></td>
</tr>-->
</tbody>
</table>
I'm pretty much e
<table>
<thead></thead>
<tbody>
<tr>
<td></td>
</tbody>
</table>
Is it possible to do the same with a table-less design (eliminating two tables per row)
You could just use the colspan attribute on a td to achieve the same effect without the tables. Ex:
<table>
<tbody>
<tr> <!--normal row stuff-->
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan='4'><!--details stuff here--></td>
</tr>
</tbody>
</table>
In this example, the td with colspan='4' will be a single cell that is the same width as the 4 cells in the previous row.