I have a style for a two column grid where I want the first column to be 1fr and the second to be 5fr (or auto). I also want the second column to wrap under the first in responsive/mobile view. My non-wrappig style is this:
.grid-two-column-wide-right {
display: grid;
grid-template-columns: 1fr 5fr;
grid-gap: 1.5rem;
}
I know I have to use repeat and auto-fill but not sure how to keep the static column widths. Any help is appreciated.
In CSS Grid, I'm trying to find the best approach to aligning 3 columns, first column to the left, then second and third aligned to the right.
The second and third columns are both dynamic widths, so I need the third column to wrap to its contents width, then push the second columns content to the 'end', so both appear to fill to the right.
I have this working(ish), but I don't think its the best/correct approach. By setting grid-template-columns on the parent container to 200px 1fr, both second and third columns align as I'd like, but I suspect this isn't the correct, or best approach.
Is anyone able to explain how this should be done?
Here is an example of how I have it currently working:
https://jsfiddle.net/Lb0qc7ep/
I am using CSS Grid as at different breakpoints, I need to rearrange the column orders.
Try this:
.container {
display: grid;
grid-template-columns: 1fr auto auto;
grid-gap: 30px;
}
I removed all other CSS when I tried this
This is the text in cell H1
<a class="stop-propagation" href="javascript:void(0);" data-link="/propertyDetails/poiOnMap.html?lat=19.2412011&longt=73.1290596&projectOrProp=Project&city=Thane&includeJs=y&type=poiMap2017&address=Thane, Maharashtra" id="map_link_27696295" onclick="stopPage=true; showPhotoMap('/propertyDetails/poiOnMap.html?lat=19.2412011&longt=73.1290596&projectOrProp=Project&city=Thane&includeJs=y&type=poiMap2017&address=Thane, Maharashtra');" style="outline: 1px solid blue;"><span class="icoMap"></span>Map</a>
From above cell I'm trying to extract element of 1st occurrence of lat and longt
This is what I have tried
=IF(LEFT(H1,2)="lat=",SUBSTITUTE(H1,"lat=",""),IF(RIGHT(H1,2)="lat=",SUBSTITUTE(H1,"lat=",""),H1))
But it doesn't gives me proper output.
This is what I Expect
lat=19.2412011
longt=73.1290596
Any help would be much appreciated.
Thanks
For the lat=19.2412011,
=TRIM(LEFT(SUBSTITUTE(REPLACE(H1,1,FIND("?",H1),TEXT(,)),"&",REPT(" ",LEN(H1))), LEN(H1)))
For the longt=73.1290596,
=TRIM(MID(SUBSTITUTE(REPLACE(H1,1,FIND("?",H1),TEXT(,)),"&",REPT(" ",LEN(H1))), LEN(H1), LEN(H1)))
For the two together in a single cell with a line feed,
=TRIM(LEFT(SUBSTITUTE(REPLACE(H1,1,FIND("?",H1),TEXT(,)),"&",REPT(" ",LEN(H1))),LEN(H1)))&CHAR(10)&TRIM(MID(SUBSTITUTE(REPLACE(H1,1,FIND("?",H1),TEXT(,)),"&",REPT(" ",LEN(H1))),LEN(H1),LEN(H1)))
I am searching for a solution that changes the column width based on largest data content or header.
Solutions like
tbody.igg_Item > tr > td
{
white-space: nowrap !important;
}
does not work because the grid sets the column width based on the column header contents not the data, thus the data cell contents is not displayed in its full length.
e.g if content is "my test data content", I can only see "my test dat" because my header is not long enough.
My markup is:
<ig:WebDataGrid ID="WebDataGrid1" runat="server" AutoGenerateColumns="False" Height="350px"
Width="100%">
<ClientEvents MouseDown="GridMouseDown" />
<Behaviors>
<ig:Activation>
</ig:Activation>
<ig:ColumnResizing>
</ig:ColumnResizing>
<ig:Selection CellSelectType="Single">
</ig:Selection>
</Behaviors>
</ig:WebDataGrid>
I am adding the columns in code behind (I have not seen any DataColumn property that controls width)
The grid will automatically size the columns to the data portion of the grid if there is no width set on the column and the grid itself doesn't have a width. Note that you will need to put the grid in a container if you want a horizontal scroll bar and if using paging the pager will scroll with the columns.
I have a more detailed answer to this question here on StackOverflow. I also have this posted in the Infragistics forums here with a sample. I also have a modification of that example that allows wrapping of text in the header if there are multiple words with sample posted here.
i want to show only the first 5 elements of a list and hide the remaining elements, when you click on a "more"-link, the remaning elements of the list must be shown...
it's a bit similar to jQuery toggle show/hide elements after certain number of matching elements but then in mootools (instead of jquery)
A good solution could be a combination of CSS + Mootools
css:
ul{
height: 50px; /* must be the same height as the 5 elements */
overflow: hidden;
}
js:
$('moreLink').addEvent('click', function()
{
$('menu').tween('height', [50, 200]);
}