Could any one help me with this, vaadin table cell borders are not aligned properly with header border, but I don't have this issue in other browser.
I have followed the rules given by vaadin to style the table, even though I have this issue.
Any help would be great!
I am sorry I have not elaborated it properly.
Below are the instructions given by vaadin for table theme.
Table theme building instructions
Vaadin scroll table is very complex widget with dozens of features. These
features set some limitations for theme builder. To keep things working, it
is safest to try to just override values used in default theme and comfort to
these instructions.
Borders in table header and in table body need to be same width
specify vertical borders on .v-table-header-wrap and .v-table-body
*
Table cells in body:
padding/border for cells is to be defined for td elements (class name: .v-table-cell-content)
in default theme there are no borders, but they should work. Just set border-right or border-bottom
no padding or border is allowed for div inside cells (class name: .v-table-cell-wrapper) element
background is allowed for both elements
*
Table headers:
table cells in header contain .v-table-resizer and
.v-table-caption-container div elements, which are both floated to right
to align header caption to body content resizer width + .v-table-caption-container
padding right should be equal to content cells padding-right and border-right.
Possible cell border in header must be themed into column resizer.
*
*/
I have followed the same instructions and below is my SCSS...
<pre>
.v-table-header-wrap{
border-top:1px solid #c6c6c6;
border-left:1px solid #e2e2e2;
background:none #e2e2e2;
height:33px;
.v-table-header{
height:33px;
position:relative;
.v-table-resizer{
height:33px;
border-left:1px solid #d0d0d0;
border-right:1px solid #eee;
width:auto;
position:relative;
z-index:1;
}
}
}
.v-table-caption-container{
background:0 none;
#include box-sizing(border-box);
padding:0.813em 0.9em;
line-height:normal;
overflow:hidden;
position:relative;
top:1px;
}
.v-table-table tr{
td{
padding:4px;
border-color:$ClDwnClr $ClLtClr rgba(0, 0, 0, 0) $ClRtClr;
vertical-align:middle;
border-style:solid;
border-width:1px;
.v-table-cell-wrapper{
color:$Color;
position:relative;
top:0;
overflow:hidden;
text-overflow:ellipsis;
}
}
}
</pre>
The real issue is table cell borders are not aligned properly with table header cell borders in SAFARI browser but this is fine with other browsers.
Related
First question is: do I really need to use tables to align/organize labels/fields on my xPage?
It's like old style development (using hidden tables) that helps group components on the form/page.
Anyway I just switched from Notes 8 to Notes 9 and apply Bootstrap 3 theme. Now all tables have top border I cannot remove. It's something weird. Even my own class doesn't remove the border.
table, th, td {
border-collapse: collapse;
}
Moreover if I try to set border size/color it works only for left,righ and bottom. If I set border size 2px then it sets the color for top border as well
table, th, td {
border: 1px solid black;
}
So how do I remove tables borders on my page. See picture below
Add the following lines to your CSS:
.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td,
.table>tbody>tr>td, .table>tfoot>tr>td {
border-top: 0px;
}
You don't need a table to align label and field. Use style "display:inline-block" and set an appropriate width:
<xp:label
value="Label1"
id="label1"
for="inputText1"
style="width:20%;display:inline-block;">
</xp:label>
<xp:inputText
id="inputText1"
value="#{sessionScope.input1}"
style="width:75%;display:inline-block;">
</xp:inputText>
Use separate classes for label and fields with those styles to set the same align to all label/fields in your application.
If you move to a Bootstrap theme you would not need the tables for alignment plus you would be creating a responsive design that could adapt to mobile devices.
I'm currently developing a site which requires headings as such:
My initial idea was to do this with border-bottom, but how would I limit the width of the border so that it doesn't go all the way across? The border needs to stop when it gets to the text.
Is this possible?
h1 {
background-color: #fff;
line-height: 1;
margin: 0;
display: inline;
position:relative;
z-index: 1;
}
h1:after {
content: '';
display: block;
border-bottom: 2px solid;
position: relative;
z-index: 0;
margin-top: -7px;
}
The length of the border is decided by the size of the element it is bordering. You could create another <div> inline with the text with border-bottom: 1px; and the other borders set to 0. You could then change the margin or width of the <div> to alter the length of the line. Note that you'd have to set a width, because an empty <div> has a width of 0 by default, so won't display.
Another possible (but not recommended) way to do it would be to use a <hr> but these are not well supported in HTML 5, so I would choose the first method personally.
A solution I can come up with is to give the title the same background-color as the page's background, and then to either transform: scale() the title up so that it overflows with the border of its parent, either scale the parent down so that its border hides behind the title's background.
See here for an example:
http://jsfiddle.net/WjRqC/1/
Oh, also, scaling can be replaced by making the title position: relative and moving it downwards a few pixels (and giving it a bit more vertical padding if you don't want the text too close to the line). Actually this is probably a better idea than scaling, because it's not CSS3, so it's more compatible.
Lookie here:
http://jsfiddle.net/7affw/1/
I'm new to stackoverflow.com and this is my first post so:
I want to have a h1-text with underline. This underline will be an image and it should have a fixed width of 420px. The text in h1 will often be wider than the 420px, but sometimes shorter. Now I know that these are the solutions to get the underline as an image, but how do I set the fixed width for the underline only?
h1 {
background-image:url('images/hrBg.jpg');
background-position: 0px bottom;
background-repeat: repeat-x;
}
Create the background image with the width of 420px.
Then use the following css
h1 {
background:url('https://images.squarespace-cdn.com/content/v1/5834a5fd9de4bb511a531745/1572560269010-YEGGAHEJ1O3AG5OAMO7M/ke17ZwdGBToddI8pDm48kEnLsHrnzeww6Ind1smsg7N7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z5QPOohDIaIeljMHgDF5CVlOqpeNLcJ80NK65_fV7S1UZMvWVOiG2zXPfa_FplZumXplNQ97KbZI2EjeHIoBACLnr1xKjsq_-rO8kOgOtwYvw/Burning-Up-BG.jpg?format=2500w') no-repeat left bottom;
min-width:420px;
}
<h1>Text here</h1>
This will ensure that the background is shown only once to with of 420px. I have added the min-width property in case the content of h1 is smaller than 420px. The no-repeat property ensures that the background is shown only once as we have set the length via the actual image.
I have the following fiddle for people to see http://jsfiddle.net/defaye/DhaHP/4/
The result on full screen: http://jsfiddle.net/defaye/DhaHP/4/embedded/result/
The problem I'm having is that when going past a certain width of resizing the window, the left column departs from the group. I need them to remain touching, with the centre column having a min-width 400 to max-width 800px, the sides width: 200px. The header should be 100% however.
Anyone know how to solve this problem? It is driving me insane.
Here is another example, compatible with IE6+: http://jsfiddle.net/DhaHP/12/
Result: http://jsfiddle.net/DhaHP/12/embedded/result
Abstract of the changes:
Changed #left and #right to be above the #center (#right before #left);
min-width and max-width on #container to 800px and 1200px respectively;
No float on #center;
margin-left and margin-right on #center equals the width of each side column;
float-left on #left and float-right on #right;
The only obs on this for IE6 is the min-width and max-width that doesn't work without a little hack or the use of IE7.js. On IE7, it works as should be.
Here's a working fiddle: http://jsfiddle.net/PhilippeVay/DhaHP/8/ (edit: now works with Chromium)
Modifications made:
HTML: #left before #center column
CSS: no relative positioning at all
display: table; on parent and table-cell on the 3 columns. This will be visually (and only visually) a table. Well, a table layout and not a table structure.
200px width on #left and #right
table-layout: fixed; on parent to switch the table algorithm to the one that respect dimensions as told by the author and not those guessed by dimensions of content of cells
Constrained widths for the parent min-width: 800px; (400+200+200) and on the grand-parent max-width: 1200px; (800+200+200) (edit: max-height on #container only worked on Fx, not Chrome). To my surprise, it works as is.
Compatibility: IE8+
You can play with inline-block with IE6/7 if needed (well, display: inline; zoom: 1; the IE6/7 equivalent of inline-block for outdated browsers)
In the image below, you can see i have two tabs help and Instructions, i want to place these two tabs next to each other where the Help tab currently is. When i use the margin-left: property, only the help button moves to the left and the instructions button stays in the same place.
The css i am using to configure this:
.v-csslayout-topbarapplicant .v-button,
.v-csslayout-topbarapplicant .v-nativebutton,
.v-csslayout-topbarapplicant-invert .v-button,
.v-csslayout-topbarapplicant-invert .v-nativebutton {
float: right;
display: inline;
margin-right:0px;
margin-left: 268px;
margin-top: -18px;
padding: 0 3px 2px 0;
line-height: 11px;
}
How can i change the spacing so that both tabs (vaadin components) move together?
You need to make sure both items are wrapped with a div. Then you set the margin-left to that div, not only one of the items.
There's no way of telling in the CSS that you posted which items are being manipulated. If both of these items, "help" and "Instructions", are in the CSS you posted, then you to need to change it so that both items exist as one, meaning in one div. If only one of these items exist in your CSS that you posted, then you have only one of them being manipulated with the CSS, and that one is floating right. Ensure both items are floated in the same direction and they are wrapped. Apply the margin to this wrapper div.
The general structure should look like this:
CSS:
#help, #instructions {
float: right;
}
div#wrapper {
margin-left: 268px;
] /* wrapper containing both items, "help" and "Instructions" */
HTML:
<div id="wrapper">
<div id="help"></div>
<div id="instructions"></div>
</div>
I think that you are having some inheritance problems.
I would suggest first checking what inheritance this property is following, and if you still have problems I would then create separate divs for Help and Instructions, where instructions has a different right margin. I hope this helps! This type of problems are stubborn.