I'm making this site for my friends mom and for some reason my links aren't working in my table, I have reason to believe that it has something to do with the CSS, also I've never had this problem before so I'm not fully sure how to fix it. The code works in Chrome but not Firefox also to clarify, I can't click on the link, it turns it blue and underlines it but I just generally can't click on it at all.
HTML
<nav>
<table id="nav_table">
<tr>
<td class="nav_border">
<p class="nav_options">Home</p>
</td>
<td class="nav_border">
<p class="nav_options">Restaurants</p>
</td>
<td class="nav_border">
<p class="nav_options">Near you</p>
</td>
<td class="nav_border">
<p class="nav_options">Order Here!</p>
</td>
</tr>
</table>
</nav>
CSS
nav{
position: relative;
top: 50px;
}
#nav_table{
position: relative;
top: 60px;
margin-left:auto;
margin-right:auto;
border-spacing: 5px 0px;
border-collapse: ;
height: 0px;
}
.nav_border{
text-align: center;
border: 2px solid black;
padding: 10px;
width: 120px;
height: 0px;
-webkit-box-shadow: rgb(,,) 0px 0px 0px ;
-moz-box-shadow: rgb(,,) 0px 0px 0px ;
box-shadow: rgb(,,) 0px 0px 0px ;
background:-webkit-radial-gradient(center,circle,red 0%, orange 50%);
background:-moz-radial-gradient(center,circle,red 0%, orange 50%);
background:radial-gradient(center,circle,red 0%, orange 50%);
-webkit-border-radius: 25px;
-moz-border-radius: 25px;
border-radius: 25px;
}
.nav_options{
font-size: 20px;
text-decoration:none;
}
Now as I said before I've never had this problem, I've tried googling it and it said it had to do with changing the parent element width and height to percentage instead of pixels but I don't think it applied to what I'm trying to get done.
You need to put 'http://' in front of your urls, so the browser knows it is an absolute URL.
e.g. href="http://www.google.com"
Without, the browser thinks the URL is relative so it's taking you to the wrong page.
It's also better backwards compatibility to put your anchor tags inside your paragraph tags.
<p class="nav_options">Home</p>
Your syntax is not correct. If you want link with text you should first try this
link text
<nav>
<table id="nav_table">
<tr>
<td class="nav_border">
Home</p>
</td>
<td class="nav_border">
<p class="nav_options">Restaurants</p>
</td>
<td class="nav_border">
<p class="nav_options">Near you</p>
</td>
<td class="nav_border">
<p class="nav_options">Order Here!</p>
</td>
</tr>
</table>
</nav>
Your cod isn`t correct , you must add < a > < / a > tag in to < p > < / p >
if you want clickable cell use it CSS for a tag :
a.Click {
width:100%;
height:100%;
display:block;
text-align:center
}
Related
In HTML I'm creating a table and make the whole cells in each row clickable. The cells are linked to a page with more details to each bill.
The cells in each row are a <a href ...>. The hyperlink on each cell are working fine, but not on the border.
Sadly I'm not allowed to show images here. https://i.imgur.com/Ti7O7pP.png
To change the cursor-arrow to cursor-pointer I already did this:
.borderCursor:hover {
cursor: pointer !important;
}
But it's just optical.
I made dat fiddle for you:
https://jsfiddle.net/otenmoten/s8reyktm/
I expect to click on the border of a cell and then redirected to the details page.
How to do?
Final solution with Thymeleaf:
<tr th:onclick="|location.href = '#{...}'|" class="dataRow">
<td> ... </td>
<td> ... </td>
..............
</tr>
You can also use box-shadow like this:
-webkit-box-shadow: inset 0px 0px 0px 3px #f00;
-moz-box-shadow: inset 0px 0px 0px 3px #f00;
box-shadow: inset 0px 0px 0px 3px #f00;
Make sure you add this style to the anchor tag
In addition to #Zohaib's comment, you can add below to keep the space inside <a>
.borderCursor a {
box-sizing: content-box;
padding: 3px;
}
Are u expecting like this:
.makeBorder {
border: 10px solid green;
}
.borderCursor:hover {
cursor: pointer !important;
}
td{
padding:5px;
}
<html>
<head>
</head>
<body>
<table>
<tr>
<td >
<a class ="makeBorder borderCursor" href = "www.google.de">KLICK ME [--1--]</a>
</td>
<td>
KLICK ME [--2--]
</td>
<td>
KLICK ME [--3--]
</td>
</tr>
<tr>
<td>
KLICK ME [--4--]
</td>
<td>
KLICK ME [--5--]
</td>
<td>
KLICK ME [--6--]
</td>
</tr>
</table>
</body>
</html>
If you do want add padding for td u can remove it.
Try to make it like this:
<td onclick="location.href ='https://www.page.com'">
I have a footer at the bottom of the page but when zooming in, the table in the middle of the screen grows but the footer doesn't. Is there any way, using basic HTML/CSS or any JS/CSS Framework that will allow me to continue it to grow.
.footer-center-vers2 {
position: relative;
background: #292929;
margin-left: 670px;
font-family: arial, Helvetica, sans-serif,verdana;
font-size: 9px;
color: #bfbfbf;
padding: 10px 0px 10px;
}
.Regulations {
padding: 0px 0px 0px 0px;
border-spacing: 0px;
margin: 0 auto;
width:1000px;
}
<table width="100%" class="Regulations">
<tr>
<td class="footer-center-vers2" style="text-align: center; vertical-align: middle;">
<span style="vertical-align: middle">
<img src="small.png" border="0" alt="My Company Ltd." /><br />
© My Insurance Company Text<br />
<br />
</span>
</td>
</tr>
</table>
At 0% Zoom, the table looks great but when you zoom in >125%, the table is no longer 100%. Any ideas, please?
Your table has the class .Regulations, for which you set a fixed width width:1000px;, which interferes with the width="100%" you set in the table tag in the HTML code. Remove one of the two.
I made a table that holds a button and i want the button in the center of the table.
The problem is that the button is aligning not in the center of the button but aligning when the button starts, so the button is a little far to the right, here is an image:
Here is my code:
<table width="100%" border="0px" style="background:transparent">
<tr>
<td height="305px">
<%-- button---%>
<div style="text-align:center;">
<a href="#" class="btn" >Conocer más</a>
</div>
</td>
</tr>
</table>
and here is the css.
.btn{
background-color:#44c767;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
border:1px solid #18ab29;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:arial;
font-size:17px;
padding:16px 31px;
text-decoration:none;
text-shadow:0px 0px 0px #2f6627;
position: absolute;
}
The other problem I am having is I can't align it vertically inside the table.
Here is a version of the code that centers your button horizontally and vertically. I tweaked the style a little because I don't think you need an absolute position and a display block for your button. But if that messes up with the rest of your page we can still do it wrapping the button inside another div. Let me know.
The vertical alignment is done by setting the line-height of your div with the same height of your TD.
HTML code:
<table width="100%" border="1" style="background:transparent">
<tr>
<td style="height:305px;">
<div style="width:100%; text-align:center;line-height:305px;">
Conocer más
</div>
</td>
</tr>
</table>
CSS code:
.btn {
background-color: #44c767;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border: 1px solid #18ab29;
cursor: pointer;
color: #ffffff;
font-family: arial;
font-size: 17px;
padding: 16px 31px;
text-decoration: none;
text-shadow: 0px 0px 0px #2f6627;
}
When you have some time try to convert that page using only divs. I think you can easily accomplish it without tables at all.
have you tried adding a width value and then using
margin: 0 auto;
in your button css. This should just move the button to the centre of its parent div. Hope this helps :)
Given the following HTML, which produces a list of charity donors and a title at the top. I'd like to add the name of the Charity at the bottom within the container.
I'm new with HTML and beginner so doing this as my first task.
CSS CODE:
/*** central column on page ***/
div #divContainer {
max-width: 50%;
margin: 0 auto;
font-family: Verdana;
padding: 1em 1em 1em 1em;
/* rounded corners */
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
/* add gradient */
background-color: #908080;
background: -webkit-gradient (linear, left top, left bottom, from(#606060), to(#C65C65));
background: -moz-linear-gradient (top, #606060, #998880);
/* add box shadows */
-moz-box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
-webkit-box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
}
/*** Donner Role ***/
table.CRG {
align="center";
vertical-align="center";
text-align:center;
border:3px solid black;
border-collapse:collapse;
}
/*** table's td element, all section ***/
table.CRG td {
color:white;
vertical-align:middle;
padding: 0.5em;
border:3px solid black;
font-weight:bold;
}
h1 {
color:#FFE47A;
font-size:1.5em;
}
HTML CODE:
<!-- CENTTERED COLUMN ON THE PAGE-->
<div id="divContainer">
<!-- HTML5 TABLE FORMATTED VIA CSS3-->
<table class="CRG" width="100%">
<!-- TABLE BODY: MAIN CONTENT from Function CRG -->
<tbody>
<h1>
<center> My Charity </center>
</h1>
<tr>
<td>Mr. Smithn</td>
</tr>
<tr>
<td>Mr. Jones</td>
</tr>
<tr>
<td>Mrs. Generous</td>
</tr>
<tr>
<td>Reserved</td>
</tr>
<tr>
<td>Reserved</td>
</tr>
<tr>
<td>Reserved</td>
</tr>
<tr>
<td>Reserved</td>
</tr>
<tr>
<td>Reserved</td>
</tr>
</tbody>
</table>
</div>
Any help would be appreciated!
There are so many ways that this might be handled...too numerous to put in one post. Here are just some general ideas. Though your data are "tabular" I won't focus on tables, but other options - alluding to the "old saw" - don't use tables for layout, use them for tabular data.
divs, using classes or pseudoclasses:
<div class='headerdiv'></div>
<div class='donordiv'></div>
<div class='donordiv'></div>
<div class='donordiv'></div>
<div class='donordiv'></div>
<div class='donordiv'></div>
<div class='donordiv'></div>
<div class='footerdiv'></div>
Unnumbered lists - styling using classes or pseudoclasses.
<ul>
<li class='headerlist'>
<ul>
<li class='donor'>donor1</li>
<li class='donor'>donor2</li>
<li class='donor'>donor3</li>
<li class='donor'>donor4</li>
</ul>
</li>
<li class='footerstuff'>footer stuff</li>
</ul>
If you like dls, dts etc, again styling with css classes or pseudoclasses.
<dl>
<dt>Title</dt>
<dd>donor 1</dd>
<dd>donor 2</dd>
<dd>donor 3</dd>
<dd>donor 4</dd>
<dt>Stuff</dt>
</dl>
And I'll bet there are many other ways that the experts will show us.
It seems to me that I horribly missing something here but I can't get the cell
of the following table to span across the whole table with. See following jsfiddle link attached:
http://jsfiddle.net/jeremysolarz/5stQc/2/
I know table design isn't nice but I'm working with a legacy application here with a lot of
gif spacer images and I want to remove this and switch to a more CSS centered layout.
Please help.
Is it necessary to have a nested table in this case? If you just had a single table and used <th colspan="3"> would this solve the issue? Sorry if this is not the case but it seems like you are overcomplicating it!
You are currently declaring the width of the table inline(in the html) and in the CSS and both values are different, you should wrap the tables in a div as follows, and remove the inline width declaration.
/* frames */
#foo{
width:100%;
display: inline-block;
}
.newframeContainer {
padding:0;
margin:0 auto;
text-align: left;
width:70%;
height: auto;
border:none;
-moz-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
-webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
border: 1px solid #B6B6B6;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
The Html should now look like this:
<div id="foo">
<table height="100%" class="newframeContainer" cellspacing="1">
<tbody>
<tr height="27">
<th colspan="3">
ADAM Statistics
</th>
</tr>
<tr height="99%">
<td class="text-bold">Total Project Budgets [USD] </td>
<td>test</td>
<td valign="top" align="right">
192,609,012
</td>
</tr>
<tbody>
</table>
</div>