I am using Datatables.js for a table in my website. I haven't changed the original CSS from datatables, but only in Mozilla, the CSS is broken for a reason.
Here is my HTML code:
<div class="full-container">
<div class="row">
<div class="col-sm-2 col-md-2 col-lg-2">
<br><br>
<center>
adsense code
</center>
</div>
<div class="col-sm-9 col-md-9 col-lg-9">
<table id="myTable" class="table table-bordered table-striped tablesorter">
table content
</table>
</div>
</div>
</div>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#myTable').dataTable();
} );
</script>
Here is how it supposed to be in Chrome and Internet Explorer
And here is how it is in Mozilla
I had the same problem. To resolve it, you must add a new class before your table with the sDom option :
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#myTable').dataTable({
"sDom": 'fi<"clear">tp'
});
} );
</script>
The syntax of sDom is available here. Adapt it according to your needs. Here we add a new div with the clear class before the table.
Then add this CSS code to fix the bug :
.clear {
clear: both;
}
Related
This is my code. It's just a basic cshtml page (not MVC) that I'm editing in a text editor. Visual Studio doesn't help much, it seems to suffer from the same issues as the compiler.
The code is printing a list of steps in a "plan" into a table, retrieved from a db query. There may be multiple plans, and each time there's a new one I want to display its name in a panel followed by its steps in a table. This means closing the current table and starting a new one.
The compiler doesn't seem to be able to handle the closing tags when they're "out of place". I've tried with and without Html.Raw() and the results are similar. Is there a technique that will work and allow this to compile?
#{
var db = Database.Open("CADDatabase");
var count=0;
var num="0";
var image="blank";
var APName="blank";
// Attached action plan for incident
var APIncidentQuery=#"select action_plan_name, action_plan_item_types.item_type_eng, pre_mobilisation_flag, instruction_text, isnull(action_plan_active.instruction_information,' ') as instruction_information, item_status_eng
from action_plan, action_plan_active, action_plan_item_types, action_plan_status
where action_plan_item_types.item_type=action_plan_active.item_type
and action_plan_active.item_status=action_plan_status.item_status
and action_plan.action_plan_id=action_plan_active.action_plan_id
and action_plan_active.eid=(select min(eid) from agency_event where num_1=#0) order by action_plan_active.action_plan_id, active_item_id";
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="theme.css">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Process Action Plan</title>
</head>
<body>
<!-- Panel header with search box -->
<div class="container-fluid ">
<div class="row no-gutters">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<form method="get" class="col-xs-3">
<div class="input-group">
<input class="form-control" type="text" placeholder="Event id" name="EventId" size="12">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">Search</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Header row -->
<div class="row no-gutters">
#foreach(var row in db.Query(APIncidentQuery,Request.QueryString["EventId"])){
image="Images/ActionPlans/" + #row.item_type_eng + ".png";
// New plan
if (row.action_plan_name != APName) {
// Close off previous table if there is one
if (APName != "blank") {
Html.Raw("</tbody></table></div></div>");
}
<!-- Start new table -->
<div class="col-xs-12">
<div class="panel panel-warning">
<div class="panel-heading">
<div class="plan-header">
<img src="http://swi-hsiv-ps03/UKApps/Images/checklist-warning.png" height="32">
<h3 class="panel-title">Action plan items (#row.action_plan_name)</h3>
</div>
</div>
<!-- Table of results -->
<table class="table table-condensed table-striped">
<thead>
<tr>
<th>#</th>
<th>Type</th>
<th>Pre-dispatch</th>
<th>Instruction</th>
<th>Additional Info</th>
</tr>
</thead>
<tbody>
<!-- store plan name for next iteration -->
#{
APName=row.action_plan_name;
}
<!-- Populate new table -->
}
<!-- List Action Plan items -->
<tr>
<td>#row.item_number</td>
<td><img src="#image" height="30" title="#row.item_type_eng"></td>
#if (row.pre_mobilisation_flag == "Y") {
<td><img src="images/ActionPlans/done-red.png" title="Y" height="30"></td>
} else {
<td><img src="images/ActionPlans/delete-grey.png" title="N" height="30"></td>
}
<td>#row.instruction_text</td>
#if (row.instruction_information.Length > 4 && row.instruction_information.Substring(0,5) == "http:") {
<td><a href=#row.instruction_information>Additional information</a></td>
} else {
<td>#row.instruction_information</td>
}
</tr>
}
#{
Html.Raw("</tbody></table></div></div>");
}
</div>
</div>
</body>
</html>
Fixed by rewriting as 2 queries, one to get the list of plans, the other to list the items within each. Then the tables are fully contained within the foreach loops.
I'm trying to use a library bootstrap selector but i have an issue with the class input-group which contains "display inline-table". selected words go out of input field. I want to keep this class without modify "display inline-table"
I tried some display initial or block on children but its not working.
Without class "input-group"
With class "input-group" but field grows
Thx for help.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/js/bootstrap-select.min.js"></script>
<div class="container">
<div class="col-sm-12 col-md-2">
<div class="panel" id="liste_diffusion">
<label> test </label>
<div class="input-group">
<select class="selectpicker" data-style="btn-primary" multiple>
<option>PHP PHP PHP PHP PHP PHP PHP PHP</option>
<option>CSS CSS CSS CSS CSS CSS CSS CSS CSS </option>
<option>HTML HTML HTML HTML HTML HTML </option>
</select>
</div>
</div>
</div>
</div>
I add informations to resolve the problem :
what's happening with max width 70% :
.bootstrap-select{
max-width: 70%;
}
Without selected elements :
With selected elements field continues to grow :
I cant use px for responsive size.
Use this style
.panel .input-group {
display: flex;
}
.bootstrap-select {
flex: 1;
}
.panel .input-group {
display: flex;
}
.bootstrap-select {
flex: 1;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/css/bootstrap-select.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.7.5/js/bootstrap-select.min.js"></script>
<div class="container">
<div class="col-sm-12 col-md-2">
<div class="panel" id="liste_diffusion">
<label> test </label>
<div class="input-group">
<select class="selectpicker" data-style="btn-primary" multiple>
<option>PHP PHP PHP PHP PHP PHP PHP PHP</option>
<option>CSS CSS CSS CSS CSS CSS CSS CSS CSS </option>
<option>HTML HTML HTML HTML HTML HTML </option>
</select>
</div>
</div>
</div>
</div>
Being new to bootstrap and scripting with html/css in general, I am attempting to create a simple html table (one row with three columns). Each column is to be even (taking up one third of the table which it exists inside of. The problem I am encountering is that it appears to be taking up only two-thirds (2/3) of the available space with in the table. I've looked on the internet for solutions, googled, read a several posts/articles on stack and other places, but I've not found a solution and am hoping for help.
You can see a straight html render of the error here
Here is a picture detailing the issue:
As the example image shows the thin red column is taking up one third of the table space (green bordered table), however that table is not expanding to occupy the full space available to it in the red div. I've looked for through the html render and not found a cause for the issue.
<div class="area">
<section class="wrapper scrollable">
<div class="main-grid">
<div class="agile-grids">
<!-- blank-page -->
<div class="blank">
<div class="blank-page">
<h1>Session is active</h1>
<table class=" " style="border: 1px solid red;">
<tbody>
<tr scope="row" style="border: 1px solid red;">
<td class="text-center" style="border: 1px solid green;">
<div class="col-lg-4 col-md-6 col-sm-12" style="border: 1px solid red;">
<div class="card_user-charProfile">
<img class=" img-fluid" style="width: 100%;" src="http://localhost/wBase/zUploads/cImg/3bgCard.jpg" alt="Wiccan">
<div class="card">
<div class="card">
<p> content goes here</p></div>
</div>
</div> <!-- end row -->
</div><!-- end CHARACTER PROFILE OUTER DIV -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
Here are the CSS declarations / links
<script language="JavaScript" type="text/javascript">
<!-- This JS disallows hijacking into someone else's frame...
if (top.location != self.location){top.location=self.location}
//-->
</script>
<link href="../__themes/bs4_marvelCSS/bs4_bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../__themes/bs4_marvelCSS/bs4_dashV3.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/style_sticky-footer-navbar.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/bs4_dashTweaks.css" rel="stylesheet">
<!-- font CSS -->
<!-- roboto -->
<link href="//fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,500italic,700,700italic,900,900italic" rel="stylesheet" type="text/css">
<!-- lato -->
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<!-- hammersmith one -->
<link href="https://fonts.googleapis.com/css?family=Hammersmith+One" rel="stylesheet">
<!-- __themes/_fonts/font-glyphicons.css -->
<link href="../__themes/bs4_marvelCSS/font.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/font-awesome.css" rel="stylesheet">
<link href="../__themes/bs4_marvelCSS/font-glyphicons.css" rel="stylesheet">
<script type="application/x-javascript">addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<script>
$(function () {
$("#supported").text("Supported/allowed: " + !!screenfull.enabled);
if (!screenfull.enabled) {
return false;
}
$("#toggle").click(function () {
screenfull.toggle($("#container")[0]);
});
});
</script>
Why are you using the table? You can handle that all with the bootstrap grid system. Avoid using table in your project. But I will suggest you to give it a width:
td{width:100% !important;}
Try doing this it may help you.
I have been trying this in any possible way, I can not figure out what is wrong here.
Here is my code
http://jsbin.com/xeroborohe/edit?html,output
and this is how I link my css
<link rel='stylesheet" type="text/css" href="https://aa4d96bd21c195e7b862b851b0818e89fb8ee102.googledrive.com/host/0B77cxO0Vjbb2MlYyUFpmVXhTUWc/knowledgetree.css" />
For some reasons the line that links to the Google drive stored style sheet is not working,. I ahve also tried to link the file locally on my drive..no luck
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript">
window.toggleDiv = function(divId) {
var ele = document.getElementById(divId);
var state=jQuery(ele).is(':visible');
jQuery(ele).toggle();
state=jQuery(ele).is(':visible');
localStorage.setItem( divId, state);
}
</script>
<script type="text/javascript">
(function($){
$( document ).ready(function() {
$(".collapsible").each(function(index) {
if (typeof($(this).attr('id'))!="undefined") {
id=$(this).attr('id');
var state = localStorage.getItem(id);
ele = document.getElementById(id);
if (state=="true") {
ele.style.display = 'block' ;}
else {
ele.style.display = 'none'; }
}
});
});
})(jQuery)
</script>
<link rel="stylesheet" type="text/css" href="https://aa4d96bd21c195e7b862b851b0818e89fb8ee102.googledrive.com/host/0B77cxO0Vjbb2MlYyUFpmVXhTUWc/knowledgetree.css" />
<a class="ConceptLevel1" href="javascript:toggleDiv('PktS/h+L5EeSqM/4hMH9JA==');" style="font-
size:13pt">Root</a><br>
<div class="collapsible" style="display:none " id="PktS/h+L5EeSqM/4hMH9JA==">
<a class="ConceptLevel2" href="javascript:toggleDiv('KlHtq+Xe60essn+0zs9E6g==');" style="font-
size:12pt">level 1</a><br>
<div class="collapsible" style="" id="KlHtq+Xe60essn+0zs9E6g==">
<div>Level 2</div>
<a class="ConceptLevel3" href="javascript:toggleDiv('EdMUp+28okWIWHVbvUaU1g==');" style="font-
size:11pt">Level 2</a><br>
<div class="collapsible" style="" id="EdMUp+28okWIWHVbvUaU1g==">
<a class="ConceptLevel4" href="javascript:toggleDiv('wIZCSCx/Xk2YShMAkF33Pg==');"
style="font-size:10pt">Level 3</a><br>
<div class="collapsible" style="" id="wIZCSCx/Xk2YShMAkF33Pg==">
<div>Level 4</div>
<a class="ConceptLevel5" href="javascript:toggleDiv('7GKbN5XRqkybT
+XsbHkyqw==');" style="font-size:9pt">Level 4</a><br>
<div class="collapsible" style="" id="7GKbN5XRqkybT+XsbHkyqw==">
<div>Level 5</div>
<a class="ConceptLevel6" href="javascript:toggleDiv
('rV75pTUXp0KP6Mx6EJznDg==');" style="font-size:8pt">Level 5</a><br>
<div class="collapsible" style="display:none "
id="rV75pTUXp0KP6Mx6EJznDg==">
<div class="details">Conclusion: for all the below levels ....</div>
<a class="ConceptLevel7" href="javascript:toggleDiv
('a5qCUDoqI0CPlS4pPGcODQ==');" style="font-size:7pt">Level 6</a><br>
<div class="collapsible" style=""
id="a5qCUDoqI0CPlS4pPGcODQ==">
<div>Level 7</div>
<div>Level 7</div>
</div>
<div>Level 6</div>
</div>
</div>
</div>
<div>Level 3</div>
</div>
</div>
</div>
Update: I have fixed the link, now it leads to a css file https://aa4d96bd21c195e7b862b851b0818e89fb8ee102.googledrive.com/host/0B77cxO0Vjbb2MlYyUFpmVXhTUWc/knowledgetree.css
You've got a single quote followed by double quotes in the first attribute in your html tag (the one you link your css with).
Try keeping an eye on your syntax coloring. Stackoverflow already does this.
Try using an IDE("Integrated Development Environment" or code assisting text editor), like Notepad++, Atom, Sublime Text 3, etc.
Google "top 10 ide's".
Good luck.
This is embarrassing, mostly for me (a programmer by night) but it should be more for the pro who rushed to sanction my typos or what they believed it would be typos.
I was using ConceptLevel in the html code and conceptlevel in css
I am wondering why jsbin worked with this
I was trying to include an HTML file in another HTML File div like follows,
<body>
<form action="#" method="post">
<div class="container">
<div class="sidebar">
<!-- Do not insert any tags here -->
</div>
<div class="contentbody">
<div class="titlearea">
<div class="userprofile"></div>
<div class="pageheading">
<h1>Page Heading</h1>
</div>
</div>
<div class="formarea">
<!-- This is where I have to put the html page which contains a navigatin menu-->
<!--#include virtual="menuset1.html" -->
</div>
</div>
</div>
</form>
But when I run it on chrome it doesn't show up (menuset1), when I test it on dreamweaver it appears from behind of all elements and not in the correct position, Please guide me on this.
I think you should use jquery like,
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
....
....
<script>
$(function(){
$(".formarea").load("menuset1.html");
});
</script>
Or use PHP like,
<div class="formarea">
<?php
include('menuset1.html');
?>
</div>
Read php inclusion of files