My problem is that I added foundation rails to my project that is created in ruby on rails and I wanted to create a small table, but this table when I create creates a white background, what I want to do is make my table transparent without Background of no color.
I tried to put a class and assigning properties but it does not work, also add the style directly, delete the cookies just in case but still does not change color, only resize.
file .css
.tabla {
width:80%;
height: 80%;
background-color:transparent;
}
file .html.erb
<table border="2" class="tabla">
<tr>
<td>Film Affinity</td>
<td><%= image_tag "film_affinity.png",:class=>"imagenPie"%></td>
</tr>
<tr>
<td>IMDB</td>
<td><%= image_tag "imdb.png",:class=>"imagenPie"%></td>
</tr>
<tr>
<td>Sensa Cine</td>
<td><%= image_tag "sensacine.png",:class=>"imagenPie"%></td>
</tr>
</table>
By default Foundation sets the background color using the selectors: table thead, table tbody, table tfoot and table tbody tr:nth-child(even) for every other row.
https://github.com/zurb/foundation-rails/blob/master/vendor/assets/scss/components/_table.scss
The following CSS should set all rows to have a transparent background color:
table tbody tr:nth-child(even), table tbody {
background-color:transparent;
}
It seems ok to me. Perhaps there is some other rules that are overriding your .tabla css. You may try to add an !important and see if that fixes it:
.tabla {
width:80%;
height: 80%;
background-color: transparent !important;
}
Otherwise, the color may come with the td or tr instead from the table. In that case, add the following rule:
.tabla tr, .tabla td {
background-color: transparent;
}
Note that using !important is usually a bad practice. Try to search and clean your css code instead of using that clause.
Also, the border attribute of tables is deprecated now. You should use border css property instead.
Related
In the table in the following View of my ASP.NET MVC Core 1.1 app, I'm trying to create some space between columns OrderNumber and ItemName. But the content of the two columns are still too close to each other. Is it because css inside my <style>....</style> below is wrong or maybe the Bootstrap's default settings for the table are overriding my css. Question: How do I create the spacing between two columns?
#model MyProj.Models.TestViewModel
<style>
table th td{
padding-left:115px;
}
</style>
<table>
#foreach (var item in Model.lstOrders)
{
<tr>
<td>
<a asp-action="TestAction" asp-route-id="#item.OrderId">#item.OrderNumber</a>
</td>
<td>
#item.ItemName
</td>
</tr>
}
</table>
You can either:
define padding for the elements in your CSS (recommended)
insert an empty column in between the two, with a '&nsbp' value (a nasty hack, but proven effective)
... and your style definition is wrong (hint: there is no element in your table).
Try simply
td {
padding: 5px;
}
Your CSS:
table th td {
padding-left:115px;
}
means:
Give every td that is a child of th that is a child of table a left padding of 115px.
Instead, what you want to do is:
table th,
table td {
padding-left:115px;
}
which means, give every th and td a left padding of 115px.
So in my .container I see that there is 1px padding on the top and bottom of the <div> which is coming from my Bootstrap include in my RoR project. Even a band-aid solution would be desirable.
The css from Bootstrap that matches these :before and :after selectors are the following:
media="all"
*:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
media="all"
.container:before, .container:after {
content: " ";
display: table;
}
What would be the inverse of these operations? Or how could I simply overwrite them before I load them in my application.css.scss file?
This is due to the clearfix that Bootstrap adds to the .container and other elements like .row, see mixins/clearfix.less in Bootstrap's repository.
The :before part is used to keep the margins from collapsing and the :after part is used to contain for example the floating columns inside a .row element. See Nicolas Gallagher's clearfix hack post for a more complete explanation.
If you don't want to keep the top margin from collapsing you can overwrite it, probably by simply setting .container:before { display: none; }
One of my service pages needs inner tabs.
I already use regular jQuery UI Tabs in the page and I would like to use a different styling for the inner tabs.
Many popular sites use inner tabs differently from the main tabs by using simple text for the tabs titles, a long underline beneath the titles and a down arrow to represent the selected tabs. (image attached).
Do you know how to style jQuery UI Tabs to place a down arrow when the tab is selected?
Oh you want to know how to create the triangle using css3. Well you can do this using css, however, your example above isn't completely possible only using css. You can't have a border on the triangle as it is created using borders.
You create the downward triangle like this
.arrow { width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid black;
}
I created what you are looking for in a fiddle.
http://jsfiddle.net/jessekinsman/Mn2sx/
However, if you want to create exactly what you have above, you could use custom icon font for the triangle then you could put a text-shadow on it and it could have a stroke.
However, that being said, if you want backward compatibility and the ability to add shadows and border to the triangle, an image is going to be your most compatible approach.
You could try adding some css to the class ui-tabs-active, something like what is shown on this website: http://www.dynamicdrive.com/style/csslibrary/item/css_triangle_arrow_divs/
Yes this is pretty easy by just styling the li element with the class="active"
Something like this
.tabs {
border-bottom: 1px solid #000;
}
.tabs li.active {
border-bottom: 1px solid #fff;
padding: 5px;
background: url(../images/arrow.png) 5px 50%;
}
The above is just sample code to give you an idea. You will have to tweak the image values to get the arrow image to line up properly.
However, I think your question might be more involved.
Are you asking how to style two separate jQuery tabs that exist on the same page with a different style?
If that is the case, I would recommend wrapping one of the styles in a element with a unique class or id. Like this:
<div class="new-tabs">
<ul class="tabs">
<li>Tab1</li>
</ul>
</div>
Then you can copy all the styling from the tabs.css (I can't remember the exact name of the css file at the present time) and add the class or id before all those rules. Like this
.tab li { something.... }
.new-tabs .tab li {something...}
Walaa, you now have a completely separate set of styles for the tabs within the container.
I would recommend working through the styles you just copied and deleting what you don't need.
Linked image shows a blue border and seperates from email body in Outlook and IE
i tried to insert this style at the top
img
{ border-style: none;
}
Still doesnt work
EDIT
img { border: 0; margin:0;}
I dont know if border="0" can be added to IMAGE tag maybe depends on your version of HTML 4.1/5 (not in the style, although you can probably leave the style as it is to style="border-style: none;"
try display:block; in your image style tag
I use Vaadin in my project, currently i'm having a problem with it. It's CSS/HTML problem and i'm not aware how can i fix it...
So the situation looks like that:
I've got HTML structure (CustomLayout) which looks like that:
<table>
<tr>
<td location="loc11"></td>
<td location="loc12"></td>
</tr>
<tr>
<td location="loc21"></td>
<td location="loc22"></td>
</tr>
(...)
</table>
I'm inserting data into td with location="xxx", the data is in some locations not everyone. CSS looks like that:
table.metric_table_layout tr td {
border-bottom: 1px dotted grey !important;
}
And here's the problem:
If the td is empty, i have borders that completly ruined my layout.
Could someone give me some CSS (that will works also in IE 7+) to fix this ?
I don't want to use JS, so i'm not sure if i can handle this with only CSS?
Thx
tzim
Try to add:
table.metric_table_layout {
border-collapse:separate;
empty-cells:hide;
}
But in IE8 there has to be a !DOCTYPE definition.
With CSS only you can use the empty-cells:hide property. It's buggy across browsers so do some previews in all (rendered ok in my IE7 from IEtester - I just had to define the border as #ccc instead of gray)
Sample: http://jsfiddle.net/EbvXQ/11/