split html table tr horizontally in to two - css

i have table with 2 columns and in 2nd column I have nested table. I want to split tr in two horizontally block... in first i put all the tds and in 2nd I put confirm and cancel buttons
<table id="ElementTable" class="customTable_01">
<thead>
<tr>
<th class="SC_a1">
#Html.DisplayName("Element")
</th>
<th class="SC_a2">
Marking-Scheme
</th>
</tr>
</thead>
<tbody>
#foreach (var item in Model._Element)
{
<tr>
<td class="SC_a1"> #Html.DisplayFor(modelitem => item.ElementTitle) </td>
<td class="SC_a2">
<input type="button" value="Add" name="button" data-id="#item.ElementID" class="k-button k-button-icontext k-grid-Add ComponentScheme_Add" />
#*Nasted Table....*#
<table class="NastedElementTable">
<thead>
<tr>
<th class="N_th">Mark Scheme Title</th>
<th class="N_th">Available-Mark</th>
<th class="N_th">Pass-Mark</th>
<th class="N_th">Merit-Mark</th>
<th class="N_th">Distinction-Mark</th>
</tr>
</thead>
<tbody>
<tr>
<td class="N_td">#Html.TextBox("Input_Title_Element", null, new { id = #item.ElementID + "_DM", #class = "ElementDistinctionMark k-grid-input k-textbox_3" }) </td>
<td class="N_td">#Html.TextBox("Input_AvailableMark_Element", null, new { id = #item.ElementID + "_AM", #class = "ElementAvailableMarks k-grid-input k-textbox_4" })</td>
<td class="N_td">#Html.TextBox("Input_PassMark_Element", null, new { id = #item.ElementID + "_PM", #class = "ElementPassMark k-grid-input k-textbox_4" })</td>
<td class="N_td">#Html.TextBox("Input_MeritMark_Element", null, new { id = #item.ElementID + "_MM", #class = "ElementMeritMark k-grid-input k-textbox_4" })</td>
<td rowspan="2" class="N_td">#Html.TextBox("Input_DistinctionMark_Element", null, new { id = #item.ElementID + "_DM", #class = "ElementDistinctionMark k-grid-input k-textbox_4" })</td>
</tr>
</tbody>
</table>
</td>
</tr>
}
</tbody>
</table>

i have found solution, notice in my table in thead there is 1 tr so trick is add two tr in tbody
<thead>
<tr>
<td></td>
....
</tr>
</thead>
<tbody>
<tr>
<td><td/>
......
</tr>
<tr>
<td>
<input type="button" value="Cancel">
<td/>
<td>
<input type="button" value="Confirm">
</td>
</tr>

Related

Multiple ngFor inside tables

Problem: td with image tag {{im.url}} shows images one below the other, but what I need is to show them side by side horizontally,
Is it possible to expand/merge that td to a size of first row so that I can put 5 images side by side ?
<tbody>
<tr *ngFor="let row of tasks; let i = index" colspan="6">
<td class="text-left" >
<b>
<u>{{row.lowtask}}</u>
</b>
<tr *ngFor="let t of row.time">
<td class="text-left">{{t.time1}}</td>
<td class="text-center">{{t.time2}}</td>
<td class="text-center">{{t.time3}}</td>
<td class="text-right">{{cnvert(t.cur1)}} </td>
<td class="text-right">{{convert(t.cur2)}} </td>
</tr>
<tr *ngFor="let im of row.images">
<td>
<img src="{{im.url}}" class="thumb"/>
</td>
</tr>
</td>
</tr>
</tbody>
You need to adjust your ngFor. Here you go:
<tbody>
<tr *ngFor="let row of tasks; let i = index" colspan="6">
<td class="text-left" >
<b>
<u>{{row.lowtask}}</u>
</b>
<tr *ngFor="let t of row.time">
<td class="text-left">{{t.time1}}</td>
<td class="text-center">{{t.time2}}</td>
<td class="text-center">{{t.time3}}</td>
<td class="text-right">{{cnvert(t.cur1)}} </td>
<td class="text-right">{{convert(t.cur2)}} </td>
</tr>
<tr>
<td *ngFor="let im of row.images">
<img src="{{im.url}}" class="thumb"/>
</td>
</tr>
</td>
</tr>
</tbody>
wrap your td in <ng-container>
<tbody>
<tr *ngFor="let row of tasks; let i = index" colspan="6">
<td class="text-left" >
<b>
<u>{{row.lowtask}}</u>
</b>
<tr *ngFor="let t of row.time">
<td class="text-left">{{t.time1}}</td>
<td class="text-center">{{t.time2}}</td>
<td class="text-center">{{t.time3}}</td>
<td class="text-right">{{cnvert(t.cur1)}} </td>
<td class="text-right">{{convert(t.cur2)}} </td>
</tr>
<tr>
<ng-container *ngFor="let im of row.images">
<td>
<img src="{{im.url}}" class="thumb"/>
</td>
</ng-container>
</tr>
</td>
</tr>
</tbody>

Is it possible to fix <footer> in bootstraptable?

i found the showFooter Property. but i do not get how to customize the Content for that.
i only need to fill three of total 8 in ...
so table Looks basically like this:
<div class="table-responsive">
<table class="table table-bordered" id="tblKontoauszug">
<thead>
<tr>
<th data-sortable="#sortable" data-sorter="dateSorter">Buchungsdat.</th>
<th data-sortable="#sortable">Belegnr.</th>
<th data-sortable="#sortable">BA</th>
<th data-sortable="#sortable" data-sorter="betragSorter">Betrag</th>
<th data-sortable="#sortable">Buchungstext</th>
<th data-sortable="#sortable">Gegenkontoart</th>
<th data-sortable="#sortable">Gegenkonto</th>
<th data-sortable="#sortable">Bezeichnung</th>
</tr>
<tr class="info text-bold">
<td>
#if ( Model.Zeilen.Count() > 0 )
{
<span>#Model.Zeilen.Min(b => b.Buchungsdatum).ToShortDateString()</span>
}
</td>
<td colspan="2">Anfangsbestand</td>
<td class="text-right">#Model.Anfangsbestand.ToString("N")</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tfoot>
<tr class="info text-bold">
<td>
#if ( Model.Zeilen.Count() > 0 )
{
<span>#Model.Zeilen.Max( b => b.Buchungsdatum ).ToShortDateString()</span>
}
</td>
<td colspan="2">Endbestand</td>
<td class="text-right #( Model.Endbestand < 0 ? "negative" : "")">#Model.Endbestand.ToString( "N" )</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
<tbody>
#foreach ( var zeile in Model.Zeilen )
{
<tr>
<td>#zeile.Buchungsdatum.ToShortDateString()</td>
<td>#zeile.Belegnummer</td>
<td title="#zeile.BelegartText">#zeile.Belegart</td>
<td class="text-right #( zeile.Betrag < 0 ? "negative" : "")">#zeile.Betrag.ToString("N")</td>
<td>#zeile.Buchungstext</td>
<td>#zeile.Gegenkontoart</td>
<td>#zeile.Gegenkonto</td>
<td>#zeile.Bezeichnung</td>
</tr>
}
</tbody>
</table>
</div>
You can customize content in the footer by adding the data-footer-formatter attribute to the column you want to add the footer to and setting that attribute equal to a defined javascript function. Here's an example:
HTML:
<table data-toggle="table" data-show-footer="true" data-footer-style="footerStyle" data-show-columns="true">
<thead>
<tr>
<th data-sortable="true" data-footer-formatter="totalText">Name</th>
<th data-sortable="true" data-footer-formatter="carsSum"># Cars</th>
</tr>
</thead>
<tbody>
<tr>
<td>Johnny</td>
<td>2</td>
</tr>
<tr>
<td>Zack</td>
<td>3</td>
</tr>
<tr>
<td>Timmy</td>
<td>2</td>
</tr>
</tbody>
</table>
Javascript:
function totalText(data) {
return 'TOTAL';
}
function carsSum(data) {
return '7';
}
function footerStyle(value, row, index) {
return {
css: { "font-weight": "bold" }
};
}
Notice I'm not using <tfoot> at all here. That is because <tfoot> won't work with the show columns dropdown list but this will (if I were to use the data-show-columns="true" attribute on the <table> element as I did in the example above). You can also style the footer using the data-footer-style attribute. In my example, I'm making all text in the footer bold.
You can see the code in action here: https://jsfiddle.net/3mou92px/9/

Override "table tr:nth-child(even/odd) td {}"

Alright, let's try this again.
This is part of the code of my table right now.
<table id="infantryTbl">
<thead>
<tr>
<th class="country">Country</th>
<th class="type">Type</th>
<th class="nr">Nr</th>
<th class="name">Name</th>
<th class="marking">Markings</th>
<th class="comment">Comment</th>
<th class="status">Status</th>
<th class="code">Code</th>
</tr>
</thead>
<tbody>
<tr>
<td class="titel" colspan="8">Parachute Company</td>
</tr>
<tr>
<td class="center">British</td>
<td class="center">Command</td>
<td class="right">2st</td>
<td class="left">Rifle/MG</td>
<td class="left">Company Cmd</td>
<td class="left">Parachute Company</td>
<td class="painted">Painted</td>
<td class="center">BBX16</td>
</tr>
</tbody>
</table>
With this css I do get every other <tr> in a different color.
table tr:nth-child(odd) td{
background:#c1c1c1;color:#1f1f1f;
}
table tr:nth-child(even) td{
background:#b0b0b0;color:#1f1f1f;
}
All good so far.
What I want is to change the background and text color on all the cells with the class "painted" and rows with the class "titel".
*.titel {background:#424242;}
.painted {background:#375e37;}*
As it is now nothing happens when I change the class since the odd/even CSS seems to override everything.
How to I make "titel" and "painted" shown?
Because you used table tr td for your odd/even rules, you need the same specificity (or higher) for your override rules, which means you can't use only the class names, like .painted, as you see in my last rule. It just doesn't do anything.
table tr:nth-child(odd) td{
background:#c1c1c1;color:#1f1f1f;
}
table tr:nth-child(even) td{
background:#b0b0b0;color:#1f1f1f;
}
table tr td.painted { /* this works */
background:yellow;
color:red;
}
table tr td.titel { /* this works */
background:red;
color:black;
}
.painted { /* this one doesn't work */
background:lime;
}
<table id="infantryTbl">
<thead>
<tr>
<th class="country">Country</th>
<th class="type">Type</th>
<th class="nr">Nr</th>
<th class="name">Name</th>
<th class="marking">Markings</th>
<th class="comment">Comment</th>
<th class="status">Status</th>
<th class="code">Code</th>
</tr>
</thead>
<tbody>
<tr>
<td class="titel" colspan="8">Parachute Company</td>
</tr>
<tr>
<td class="center">British</td>
<td class="center">Command</td>
<td class="right">2st</td>
<td class="left">Rifle/MG</td>
<td class="left">Company Cmd</td>
<td class="left">Parachute Company</td>
<td class="painted">Painted</td>
<td class="center">BBX16</td>
</tr>
<tr>
<td class="titel" colspan="8">Parachute Company</td>
</tr>
<tr>
<td class="center">British</td>
<td class="center">Command</td>
<td class="right">2st</td>
<td class="left">Rifle/MG</td>
<td class="left">Company Cmd</td>
<td class="left">Parachute Company</td>
<td class="painted">Painted</td>
<td class="center">BBX16</td>
</tr>
<tr>
<td class="titel" colspan="8">Parachute Company</td>
</tr>
<tr>
<td class="center">British</td>
<td class="center">Command</td>
<td class="right">2st</td>
<td class="left">Rifle/MG</td>
<td class="left">Company Cmd</td>
<td class="left">Parachute Company</td>
<td class="painted">Painted</td>
<td class="center">BBX16</td>
</tr>
<tr>
<td class="titel" colspan="8">Parachute Company</td>
</tr>
<tr>
<td class="center">British</td>
<td class="center">Command</td>
<td class="right">2st</td>
<td class="left">Rifle/MG</td>
<td class="left">Company Cmd</td>
<td class="left">Parachute Company</td>
<td class="painted">Painted</td>
<td class="center">BBX16</td>
</tr>
<tr>
<td class="titel" colspan="8">Parachute Company</td>
</tr>
<tr>
<td class="center">British</td>
<td class="center">Command</td>
<td class="right">2st</td>
<td class="left">Rifle/MG</td>
<td class="left">Company Cmd</td>
<td class="left">Parachute Company</td>
<td class="painted">Painted</td>
<td class="center">BBX16</td>
</tr>
</tbody>
</table>

I have list i want to delete with checkbox 1 or multiple and want to status 0 using Springs MVC

I have list which is featch from database on jsp like and i want to delete using checkbox with single row and multiple rows how to delete it with row id i have jsp code
<table id="example" class="table table-bordered table-striped dashboardtable" cellspacing="0" >
<thead class="thead">
<tr>
<th class="head" style="width:14%"><span>Serial Number</span></th>
<th class="head" ><span>Images List</span></th>
<th class="head"><span>Image Preview</span></th>
<th class="head" ><span>Email Id</span></th>
<th class="head" ><span>Sent Mail Time Span</span></th>
<th class="head" ><span>Resend Image</span></th>
<th></th>
<th class="head"><input type="checkbox" id="selecctall"/>Select All</th>
</tr>
</thead>
<tbody>
<c:forEach items="${emailImagesList}" var="al">
<tr>
<td style="width:14%">${al.serialNumber}</td>
<td >${al.mailImageName}</td>
<td><img src="<%=request.getContextPath()%>/emailImage/${al.id}/" height="100" width="150" ></td>
<td>${al.emailId} <img src="<%=request.getContextPath()%>/resources/images/edit.png" onclick="showpopup1('${al.id},${al.emailId}');"/></td>
<td>${al.mailSentTime}</td>
<td>Resend Image</td>
<td> <img onclick="javascript:exportToForm('${al.id}')" src="<%=request.getContextPath()%>/resources/images/delete.png" /></td>
<td><input class="checkbox1" type="checkbox" name="${al.id}"/><a href="#" onclick="javascript:deleteToForm('${al.id}')" >delete</a></td>
</tr>
</c:forEach>
and script is
function deleteToForm(id) {
var del = confirm("Press Ok to delete!");
if (del == true ) {
window.location="<%=request.getContextPath()%>/deleteImageByUser?id="+id
}
}
how to get all table list id and how it status is 0

I want to page break in pdf reporting from mvc3 razor view to pdf

I am working in mvc3 razor view. I create pdf report from mvc3 razor view below is my controller code.
public ActionResult PReqDocPrint()
{
List<PReqPrintModel> Rec = new List<PReqPrintModel> { };
Rec = PReqPrint("", "", "");
return this.ViewPdf("Purchase Requisition", "PReqDocPrint", Rec);
}
I get data from database through stored procedure and return to controller
and my view code is given below.
#model IEnumerable<CBS.Models.PReqPrintModel>
#{
Layout = "~/Views/Shared/_LayoutForPrints.cshtml";
}
<table border="1" >
<tr>
<td>
<h2 style="text-align:center; font-family:Times New Roman;">Purchase Requisition</h2>
</td>
</tr>
</table>
<div style="color:Black;border-width:0px 1px 1px 0px;font-size:8px; font-weight:normal; page-break-before:always;">
#{
var OddColor = "#aaaaff";
var evenColor = "#EEFFFF";
var Odd = OddColor;
var eve = evenColor;
}
<table style="font-family:Times New Roman; font-size:small">
#foreach (var doc in Model.GroupBy(d => d.PReqNo))
{
foreach (var pre in doc)
{
<tr style="border:1;">
<td>
Purchase Requisition: #Html.Encode(pre.PReqNo)
</td>
<td>
Purchase Date: #String.Format("{0:dd/MM/yyyy}", #Html.Encode(pre.PReqDate.Date))
</td>
</tr>
<tr style="border:1;">
<td>
Store Location: #Html.Encode(pre.StName)
</td>
<td>
Department: #Html.Encode(pre.DeptName)
</td>
</tr>
<tr style="border:1;">
<td>
Remarks: #Html.Encode(pre.RefRemarks)
</td>
<td></td>
</tr>
}
<tr >
<td colspan="2">
<table border="1" style="color:Black;border-width:0px 1px 1px 0px;font-size:8px;font-family:Helvetica;font-weight:normal;">
<tr style="background-color:#7070a0; font-weight:bold; color:Black; border:1;" >
<td align="left">
Code
</td>
<td align="left">
Description
</td>
<td align="left">
Unit
</td>
<td align="left">
Part No
</td>
<td align="left">
Lot No
</td>
<td align="left">
Item Remarks
</td>
<td align="right">
Quantity
</td>
<td align="right">
Amount
</td>
</tr>
#foreach (var item in doc)
{
<tr bgcolor="#Odd">
<td align="left">
#Html.Encode(item.ItemCode)
</td>
<td align="left">
#Html.Encode(item.ItemDesc)
</td>
<td align="left">
#Html.Encode(item.Units)
</td>
<td align="left">
#Html.Encode(item.PartNo)
</td>
<td align="left">
#Html.Encode(item.LotNo)
</td>
<td align="left">
#Html.Encode(item.Remarks)
</td>
<td align="right">
#Html.Encode(item.QtyIN)
</td>
<td align="right">
#Html.Encode(item.Qty)
</td>
</tr>
}
if (Odd == OddColor)
{
Odd = evenColor;
}
else
{
Odd = OddColor;
}
}
</table>
</td>
</tr>
}
</table>
</div>
<div class="break"></div>
Below is my PDF result image which return from view
Here I want to start new PDF page When second Purchase Requisition no 2014030001 start. Any one please help me.
i already try inline CSS for page break or table page-break-before:always; and also try a separate div tag with page-break-before:always; but nothing obtain my required result.
Also it not apply separate style sheet formats on PDF view.

Resources