I am trying to show a lot of results at once (like 25) but my program cut the results around the 5th record having area space still available, the results are in a table
created dynamically but seems that the area doesn't expand accordingly.
<div id="contenido" class="contenido">
<div id="Tabs">
<ul style="cursor:pointer;">
<li id="li_tab1" onclick="tab('tab1')" >
<a>Últimas alertas</a> </li>
<li id="li_tab2" onclick="tab('tab2')"> <a>otras</a> </li>
</ul>
<div id="Content_Area">
<div id="tab1">
<p class="notas">Showing last alerts</p>
<table>
<tr>
<td style="color:blue">Alert</td>
<td style="color:blue">User</td>
</tr>
<?php
while ( $row = $result->fetch_array() ){
echo "<tr><td>".$row['DESCRIPTION']."</td>";
echo "<td>".$row['EMAIL']."</td>";
echo "<td>".$row['SUB_SECCION']."</td></tr>";
}
}
else
echo "error on query: ".$conx->error;
}//else
?>
</table>
</div>
<div id="tab2" style="display: none;">
<!-- We set its display as none because we don’t want to make this
tab visible by default. The only visible/active tab should
be Tab 1 until the visitor clicks on Tab 2. -->
<p>This is the text for tab 2.</p>
</div>
</div> <!-- End of Content_Area Div -->
</div> <!-- End of Tabs Div -->
</div>
CSS creates tabs, but for the moment only the first has the table the other just one line of text, but the table is inside this tab div
archivo css
.contenido {
color: black;/*#333*/
background-color: #F2F2E6;
margin: 0px 0px 5px 0px;
padding: 10px;
border: 1px solid #ccc;
width: 75%;/*678px;*/
height: 480px;
float: right;
display: inline;
}
#Tabs ul {
padding: 0px;
margin: 0px;
margin-left: 10px;
list-style-type: none;
}
#Tabs ul li {
display: inline-block;
clear: none;
float: left;
height: 24px;
}
#Tabs ul li a {
position: relative;
margin-top: 16px;
display: block;
margin-left: 6px;
line-height: 24px;
padding-left: 10px;
background: #f6f6f6;
z-index: 9999;
border: 1px solid #ccc;
border-bottom: 0px;
/* make the top left and top right corners of each tab rounded. */
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
/* end of rounded borders */
width: 130px;
color: #000000;
text-decoration: none;
font-weight: bold;
}
#Tabs ul li a:hover {
text-decoration: underline;
color:red;
}
#Tabs #Content_Area {
/* this is the css class for the content displayed in each tab */
padding: 0 15px;
clear:both;
overflow:hidden;
line-height:19px;
position: relative;
top: 20px;
z-index: 5;
height: 150px;
overflow: hidden;
}
p { padding-left: 15px; }
The problem is inside your CSS.
height: 150px; and overflow: hidden; in #Tabs #Content_Area could be factor.
Since you have overflow: hidden; set to "hidden", it could be a factor.
Try changing it to overflow:scroll; or overflow:visible; to see if that works, and/or changing the heights to a higher number for those IDs.
Try different variations.
I see a two possible causes:
The database query only returns 5 results
the DIV is not large enough, and even though the table ends up in,
say, 25 records, the first 5 are only displayed and the rest are
hidden by the boundaries of DIV.
It would help if you put some more PHP code or even the CSS of the #area.
Related
I have figured out a new problem in TCPDF (new for me), ie I can't place elements next to each other. I have tried so many solutions but they were zero in the end. Seems like TCPDF doesn't support the converting from all the css attributes. Hope you can help ;)
The code I had tried:
<style>
.protHeader{
position: relative;
border: 2px solid black;
display: table;
height: 250px !important;
}
.protHeader div{
width: 100%;
}
.protHeader div img{
position: relative;
display: inline-block;
float: left;
height: 100px;
overflow: hidden;
}
.protHeader div a{
position: relative;
display: inline-block;
text-align: right;
horiz-align: right;
overflow: hidden;
float: right;
font-weight: bold;
font-size: 50px;
width: 40% !important;
}
</style>
And the html:
<div class="protHeader">
<div class="fl_left">
<div style="border: 1px solid black;"><img src="$LogoN"></div>
<div style="border: 1px solid black;"><a>$protocol</a></div>
</div>
</div>
Thanks in advance for the answers!
Maybe this is your problem:
You are adding this:
.protHeader div{
width: 100%;
}
that means, that every <div> in your class .protHeader has 100% width.
EDIT: (i change the last part of the css and colored the inline-block divs red, for viewing that they should stay next each other)
Try to remove this line or change your styling to:
.protHeader{
position: relative;
border: 2px solid black;
display: table;
height: 250px !important;
}
.protHeader .fl_left{
width: 100%;
}
.protHeader div img{
position: relative;
display: inline-block;
float: left;
height: 100px;
overflow: hidden;
}
.protHeader div a{
position: relative;
display: inline-block;
text-align: right;
overflow: hidden;
float: right;
font-weight: bold;
font-size: 50px;
width: 40% !important;
}
.protHeader .fl_left div {
background-color: red;
display: inline-block;
}
<div class="protHeader">
<div class="fl_left">
<div style="border: 1px solid black;"><img src="$LogoN"></div>
<div style="border: 1px solid black;"><a>$protocol</a></div>
</div>
</div>
Okay, found a method, I had changed the whole framework to another (dompdf), which is easier to use and supports the newer CSS too.
I'm using standard CSS/HTML for designing my website. Using a table for the navigation, I assign my "#nav table" with a width of 100% and my "#nav th" with a height of 50px.
My issue is that it's not actually setting itself to what I define. I had assumed it was as easy as just saying height: 50px but even when I define it as 0px it remains at 90.5px. In the HTML I did define my cells and what the table was, etc.
How can I fix this? Right now my site header is outrageously large because my table cells won't adjust to what I define them.
Using just PHP, HTML, and CSS.
CSS:
#nav table {
margin: 15px;
width: 100%;
position: fixed;
}
#nav th {
height: 0px;
border: 5px black solid;
padding: 25px;
text-align: center;
white-space: nowrap;
letter-spacing: 0px;
word-spacing: 5px;
}
HTML:
<center>
<table id="nav">
<tr>
<th><h1>LINK</h1></th>
<th><h1>LINK1</h1></th>
<th><h1>LINK2</h1></th>
<th><h1>LINK3</h1></th>
<th><h1>LINK4</h1></th>
<th><a href="LINK5><h1>LINK5</h1></a></th>
</tr>
</table>
</center>
<p>
Page Directory:
Using the code #nav table assumes an element with the ID "nav" with a table inside, and not a table element with the id "nav".
<style type="text/css">
/* For a table with the id of 'nav'. You could equally remove 'table'. */
table#nav {
margin: 15px;
width: 100%;
position: fixed;
}
#nav th {
height: 0px;
border: 5px black solid;
padding:0 25px;
text-align: center;
white-space: nowrap;
letter-spacing: 0px;
word-spacing: 5px;
}
th h1 {
margin:0;
}
</style>
<center>
<table id="nav">
<tr>
<th><h1>LINK</h1></th>
<th><h1>LINK1</h1></th>
<th><h1>LINK2</h1></th>
<th><h1>LINK3</h1></th>
<th><h1>LINK4</h1></th>
<!-- Don't forget to close all hrefs with a double-quote: -->
<th><h1>LINK5</h1></th>
</tr>
</table>
</center>
https://jsfiddle.net/cz1o8a2n/1/
Note that if you have an element inside of your th that is 90.5px tall, you will not be able to make the table header less tall using CSS (unless you use CSS to decrease the height of that element).
Edit: Consider using the more moder nav instead, with list-items. Plus, you'll have an easier time making your site responsive if you like. :)
<style type="text/css">
nav {
margin: 15px;
width: calc(100% - 30px);
position: fixed;
text-align:center;
}
nav ul {
padding-left:0;
list-style:none;
}
nav li {
display:inline-block;
border: 3px black solid;
padding:0 20px;
text-align: center;
white-space: nowrap;
letter-spacing: 0px;
word-spacing: 5px;
margin:2px 0;
}
</style>
<nav id="nav">
<ul>
<li>LINK</li>
<li>LINK1</li>
<li>LINK2</li>
<li>LINK3</li>
<li>LINK4</li>
<li>LINK5</li>
</ul>
</nav>
https://jsfiddle.net/cz1o8a2n/2/
HTML
You're missing a " for LINK5.
<center>
<table id="nav">
<tr>
<th><h1>LINK</h1></th>
<th><h1>LINK1</h1></th>
<th><h1>LINK2</h1></th>
<th><h1>LINK3</h1></th>
<th><h1>LINK4</h1></th>
<th><h1>LINK5</h1></th>
</tr>
</table>
</center>
CSS
If you want to apply css to a table with the id set to nav your selector needs to be table#nav. As for the table headings being larger than you like, the issue is the h1 tag inherently has a pretty big margin. This big margin is making your table headings larger than you'd like.
table#nav {
margin: 15px;
width: 100%;
position: fixed;
}
#nav th {
height: 50px;
border: 5px black solid;
text-align: center;
white-space: nowrap;
overflow: hidden;
}
#nav th h1 {
margin: 0;
}
I am using the woo-commerce plugin within my Wordpress environment and there are category pages which I need to change the colour of a div background depending on which category are you in.
So I have like a banner across the top which is found in 'archive-product.php'
the div is named 'publicationsHeader'
I need it to change the background when you are category pages like so..
?product_cat=creative
I am a bit stuck on the best approach?
Here is my code:
<div class="publicationsHeader">
<section>
<div class="introLeft">
<h2>Publications</h2>
<h3 style="font-size: 1.2em;
color: #fff;
line-height: 28px;
padding-top: 20px">We write and produce current, practical and highly effective publications that teachers and pupils can use with immediate effect. All resources have been revised for the 2014/15 academic year.</h3>
</div>
<div class="introRight">
<a href="https://www.facebook.com/JaneConsidineEducation" target="_blank">
<button style="background-image:url(img/facebookIcon.png)"></button>
</a>
<a href="https://twitter.com/janeconsidine" target="_blank">
<button style="background-image:url(img/twitterIcon.png)"></button>
</a>
</div>
</section>
</div>
.publicationsHeader{
background-color: #e84b34;
box-sizing:border-box;
padding: 40px 0;
height: auto;
overflow:auto;
}
.publicationsHeader h2{
font-size:3em;
color: #fff;
text-shadow: 0px 4px 1px rgba(0, 0, 0, 0.3);
}
.publicationsHeaderLeft{
background-color: #fff;
box-sizing: border-box;
padding:40px 20px;
float:left;
width: 50%;
}
.publicationsHeaderLeft input{
border: solid #ccc thin;
width:95%;
font-size:16px;
padding: 10px 5px;
margin: 10px 0;
}
.publicationsHeaderLeft textarea{
border: solid #ccc thin;
width:95%;
font-size:16px;
padding: 10px 5px;
margin: 10px 0;
resize:vertical;
}
.publicationsHeadereft button{
background-color: #ec4a2c;
border: none;
color: #fff;
padding: 10px 20px 10px 20px;
font-size:16px;
}
.publicationsHeaderRight{
background-color: #fff;
box-sizing: border-box;
padding:40px 20px 160px 20px;
float:right;
width: 50%;
}
.publicationsHeaderRight li{
padding: 5px 0;
}
Why not just use the body_class() function? It adds a bunch of class names to your body tag that reflect the current page; in the case of WooCommerce it will add classes for .woocommerce, tax-product_cat and a class identifying that particular category, such as: .term-my-product-cat.
Using these you could style everything quite simply:
.publicationsHeader{
background-color: #e84b34; /* Default colour */
}
.term-product-cat-1 .publicationsHeader {
background-color: red; /* Change background for header for category 1 only */
}
.term-product-cat-2 .pulicationsHeader {
background-color:blue; /* Change background for category 2 */
}
You can read more about body_class() here.
First fetch the get data in a variable with some default:
$pcat = empty($_GET['product_cat']) ? 'default' : $_GET['product_cat'];
Then make your div like this:
<div id="publicationsHeader" class="<?php echo $pcat;?>">
</div>
Define a class in your css file like this:
.creative {
background: url(images/creative.png);
}
.default {
background: url(images/default.png);
}
You could do the following: check which category is currently displaying and give the $background variable a color accordingly. Like so:
if(is_product_category('creative')){
$background = "#ffffff";
}
Then call the $backgroundin the stylesetting of your div, like so:
<div id="publicationsHeader" style="background-color: <?php echo $background; ?>">Content goes here</div>
You can grep the parameter $_GET["product_cat"] and wrap that in a if-clause to set the css-class of publicationHeader via javaScript.
this is my worksite - mysite i have created a page and called it to the home page using the following code
<div class="hilight-hometext">
<?php if(is_front_page()) :
$home_page_post_id = 308;
$home_page_post = get_post( $home_page_post_id, ARRAY_A );
$content_home = $home_page_post['post_content'];
$content_title = $home_page_post['post_title'];
?><?php
echo $content_home;
endif; ?></div>
and the result is
<div class="hilight-hometext">
<div id="hilightbox">
<div class="hilightbox-text">
<h2>At Salisbury we want everyone to understand their landscaping choices</h2>
Our latest landscaping innovation is our Outdoor Vision questionnaire. We’ll guide you through a set of questions that will help you realize what you want out of your yard.
</div>
<!-- end tier 2 text -->
<div class="hilightbox-action">
<a class="myButton" href="resources/the-outdoor-vision-tool/">GET STARTED</a>
Your Outdoor Vision
</div>
</div></div>
i have added the styling as follows
#hilightbox {
background: url(../img/action-bg.jpg);
width: 100%;
margin: 20px auto;
}
#hilightbox .hilightbox-text {
width: 75%;
float: left;
margin: 0;
}
#hilightbox .hilightbox-action {
width: 25%;
float: left;
padding: 15px 0;
}
.myButton {
background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #c9df23), color-stop(1, #747728));
background: -moz-linear-gradient(center top, #c9df23 5%, #747728 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c9df23', endColorstr='#747728');
background-color: #c9df23;
display: inline-block;
color: #ffffff;
font-family: Arial;
font-size: 20px;
font-weight: bold;
padding: 14px 14px;
text-decoration: none;
text-shadow: 1px 1px 0px #747728;
}
but the background image and the styles are not showing up.Please help!! Thanks
I think if you just add this:
#hilightbox {
background: url(../img/action-bg.jpg);
width: 100%;
margin: 20px auto;
overflow: hidden;
}
it will solve you problem.
currently your container div #hilightbox does not know about child div's (.hilightbox-text and hilightbox-action) height & width because of float:left property.
I have a drop down list which I styled but I still can't get why does the text always align differently in chrome and in firefox. I tried adding text-align:center; on my css and the firefox make the selection list centered but is not centered vertically while in chrome it doesn't centered it all but at least it's verticall alignment is centered. Here's the output of it currently (text-align center part removed):
Firefox rendering:
Chrome rendering:
this is my css code so far:
div container for the dropdown:
.container {
background-color:#424141;
border:1px solid #424141;
width:280px;
height:40px;
font-size:13pt;
font-weight:bold;
padding-right: -20px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
and for the drop down:
.dropdown {
background-color:#424141;
border:1px solid #424141;
position:absolute;
color: #000000;
width:280px;
height:40px;
font-size:13pt;
font-weight:bold;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
and here's the result after adding text-align:center; on the dropdown class:
in chrome it remains the same as above.
Here's the html code for this. well it's inside a table I think I can just skip the other part:
<tr>
<td><p class="titles">City</p></td>
<td><div class="container"><select name="city" tabindex="16" class="dropdown">
<?php foreach ($cities as $city1): ?>
<option <?php echo "value='".$city1['city']."'"; if($city1['city']==$city){echo "selected='selected'";} ?>>
<?php echo $city1['city']; ?>
</option>
<?php endforeach ?>
</select></div></td>
</tr>
What you are trying to do cannot be done cross-browser using HTML/CSS because the HTML/CSS specification doesn't actually SAY how CSS or styling is supposed to be applied to form elements. Actualy you can write your own dropdown with javascript:
html:
<div id="search_result_fake_container">
<input id="search_result_fake" value="- All Categories -">
<div id="search_result_fake_div"></div>
</div>
<div id="search_result_present_list">
<div class="search_result_list_item" id="search_result_item_1" style="text-align:center;">item1</div>';
<div class="search_result_list_item" id="search_result_item_2" style="text-align:center;">item2</div>';
<div class="search_result_list_item" id="search_result_item_3" style="text-align:center;">item3</div>';
</div>
js:
<script type="text/javascript">
$(document).ready(function () {
$("#search_result_fake_div").live("click", function () {
$("#search_result_present_list").show("fast");
});
$("#search_result_present_list").live("mouseleave", function () {
$("#search_result_present_list").hide();
});
$(".search_result_list_item").live("click", function () {
$("#search_result_fake").val($(this).html());
$("#search_result_present_list").hide();
});
})
</script>
css:
#search_result_fake {
-moz-box-sizing: border-box; /* for Firefox */
-webkit-box-sizing: border-box; /* for Safari $ Chrome */
box-sizing: border-box; /* for IE $ Opera */
padding-left: 5px;
width: 100%;
font-size: 90%;
outline: none;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
height: 100%;
}
#search_result_fake_div {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
cursor: pointer;
}
#search_result_present_list {
display: none;
position: absolute;
text-align: left;
top: 85px;
left: 65%;
font-size: 90%;
overflow: auto;
background-color: #eae7e7;
border: #6f6f6f solid 1px;;
height: 190px;
width: 23%;
z-index: 4;
}
css is copy paste but i hope you understand what i meen