Angular HTML equal height - html

I am trying to set equal height for every single item in the list. Here as you can see in the picture some channels have companion channels(e.g CNN & HLN, BNN & CP24), they are having a different height setting as compared to the channels without any companion channels. How do I make it the same height? The second thing I am trying is to not have any channels get in the line of the alphabets(e.g the Cottage Life channel gets more to the left which gets in the line of the alphabets). Also how do I put a space between rows, I tried putting in which didn't work(e.g after the A head and its channels row i need to put a blank space).
<div class="container col-lg-8" style="float:Left">
<ul class="w3-ul w3-card-4" *ngFor="let head of channelDisplayHeads" style="clear:both">
<h1 align="center" style="background-color:#0083BC;">
<font color="white">{{ head }}</font>
</h1>
<ul *ngFor="let channel of channelList">
<li class="list-group-item logoDisplay" *ngIf="channel.channel.substr(0, 1) === head">
<div *ngIf="channel.compChannel.compChannelLogo.length !== 0; else noCompChannel">
<img class="img-rounded" src="{{ channel.logo }}" alt="{{ channel.channel }}">
<img class="img-rounded" src="{{ channel.compChannel.compChannelLogo }}" alt="{{ channel.channel.compChannelName }}">
</div>
<ng-template #noCompChannel>
<img class="img-rounded" src="{{ channel.logo }}" alt="{{ channel.channel }}">
</ng-template>
<br>
<span class="w3-left">
<mark>
<font size="1">{{ channel.cbsCode }}</font>
</mark>
</span>
<span class="w3-right">
<font size="2">{{ channel.pickCode }}</font>
</span>
</li>
</ul>
</ul>
</div>

Related

Group images with border - Angular

I am trying to group some img's with a border.
As you see in the picture below the BNN & CP24 are combo channels and I used div element to create that border. The only issue I have here is when I use div element it changes the size of the combo channels. Here the BNN & CP24 combo channel is slightly taller than the individual channels. I dont have any CSS attached to the div element. Code with the div element below.
<div *ngIf="channel.compChannel[0].compChannelLogo.length !== 0; else noCompChannel">
<img class="img-rounded" src="{{ channel.logo }}" alt="{{ channel.channel }}" width="100" height="100">
<img class="img-rounded" src="{{ channel.compChannel[0].compChannelLogo }}" alt="{{ channel.compChannel[0].compChannelName }}"
width="100" height="100">
</div>
<div #noCompChannel>
<img class="img-rounded" src="{{ channel.logo }}" alt="{{ channel.channel }}" width="100" height="100">
</div>
But when i use ng-container I get actual size but I am not able to create a border on the combo channels. code with ng-container below.
<ng-container *ngIf="channel.compChannel[0].compChannelLogo.length !== 0; else noCompChannel">
<img class="img-rounded" src="{{ channel.logo }}" alt="{{ channel.channel }}" width="100" height="100">
<img class="img-rounded" src="{{ channel.compChannel[0].compChannelLogo }}" alt="{{ channel.compChannel[0].compChannelName }}"
width="100" height="100">
</ng-container>
<ng-template #noCompChannel>
<img class="img-rounded" src="{{ channel.logo }}" alt="{{ channel.channel }}" width="100" height="100">
</ng-template>

Accessing custom front matter variable in collection documents

I have a Jekyll collection document in the collection coding:
---
title: 'iOS iConify'
rawname: iosiconify
image: {{site.img}}/z-iosiconify.png
layout: post
link: https://iosiconify.github.io/
---
Hi!
I'm trying to render all of the documents in the collection coding on an html page, and I have the following code:
{% for post in site.coding %}
<tr id="{{ post.rawname }}-desktop">
<td id="left">
<a href="{{ post.link }}" target="blank" id="{{ post.rawname }}-desktop-a">
<img src="{{ post.image }}">
</a>
</td>
<td id="right">
<h2>{{ post.title }}</h2>
<h4>{{ post.content }}</h4>
</td>
</tr>
{% endfor %}
I'm referencing a lot of my custom front matter variables in it, such as {{ post.rawname }}. However, when the page builds the only part that works is {{ post.content }}.
Here is the rendered HTML:
<tr id="-desktop">
<td id="left">
<a href="" target="blank" id="-desktop-a">
<img src="">
</a>
</td>
<td id="right">
<h2></h2>
<h4><p>Hi!</p>
</h4>
</td>
</tr>
Do you have any idea why none of the custom front matter variables are working and how I can get them to work?
There is an error in Front-matter that prevents Jekyll to correctly processing it, displaying only the content.
This line image: {{site.img}}/z-iosiconify.png should be image: z-iosiconify.png.
Then when displaying the documents preppend site.img like {{ post.image | prepend: site.img }}.e.g.:
{% for post in site.coding %}
<tr id="{{ post.rawname }}-desktop">
<td id="left">
<a href="{{ post.link }}" target="blank" id="{{ post.rawname }}-desktop-a">
<img src="{{ post.image | prepend: site.img }}">
</a>
</td>
<td id="right">
<h2>{{ post.title }}</h2>
<h4>{{ post.content }}</h4>
</td>
</tr>
{% endfor %}

how to bring two td cells closer

for my website I'm trying to bring two td closer. They are so far apart, I've been trying to put the td with numbers and td with image together. This is the domain for my webiste:
If you check the code, you can see it's horrible which is probably why I'm having such a hard time trying to bring two td closer.
To be more clear, what I'm trying to do is
<table>
<td class="vert-align" style="padding:0;" >
<div class="votes">
<a href="/post/{{ post.slug }}/vote?is_up=1" class="vote">
<span class="glyphicon glyphicon-triangle-top col-md-12" aria-hidden="true"></span></a>
<br />
<span class="col-md-12" style="height:1px; font-family: 'Passion One', cursive; bottom:10px; padding-left:0.01em;
#and
<td class="vert-align">
{% if post.main_image %}
<h4 id="lineForUrl">
<a href="{{ post.url }}" target="_blank" style="margin-left: 15px; text-decoration:none;"> <img src="{{post.get_image_url}}" class="img-rounded" alt="Cinque Terre" height="75" width="75"/><span id="title-font" title="{{post.title}}">
{{ post.title }}</span><span style="margin-left: 15px;" class="domain">({{ post.domain }})</span></a>
<span class="discuss" style="color:red;">enter</span>
<br />
<span class="post-info">
{% if user.is_authenticated %}
{{ post.moderator.user }}wrote
{% else %}
{{ post.moderator.user }}wrote
{% endif %}
#{{post.category}}</span>
</h4>
"><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br>
<a href="/post/{{ post.slug }}/vote?is_up=0" class="vote">
<span class="glyphicon glyphicon-triangle-bottom col-md-12" aria-hidden="true"></span></a>
</div>
</td>
</table>
#closer
Try this CSS line (if I have correctly understood your problem)
#cell td.vert-align:first-child { width: 40px;}
It will get your td with numbers and td with images closer

how to reduce white space(right width) in my box

Hello I have two contents in my table, so two boxes that contain contents in html. I want to reduce the distance between these two boxes, but I realized size of one box is too big that they are just white space. I'm having trouble reducing that size. can someone please help me with this?
so, cell x and cell y that's in same row to be located closer.
<table class="table">
<tr id="cell">
---------------------------------------------------------------(one cell)
<td class="vert-align">
<div class="voting-space">
<a href="/post/{{ post.slug }}/vote?is_up=1" class="vote">
<span class="glyphicon glyphicon-triangle-top col-md-12" aria-hidden="true"></span></a>
<br />
<span class="col-md-12" style="height:1px; font-family: 'Passion One', cursive; bottom:10px; padding-left:0.01em;
"><h4 id="vote_count_{{ post.slug }}">{{ post.get_vote_count }}</h4></span> <br>
<a href="/post/{{ post.slug }}/vote?is_up=0" class="vote">
<span class="glyphicon glyphicon-triangle-bottom col-md-12" aria-hidden="true"></span></a>
</div>
</td>
--------------------------------------------------------------------(the other cell)
<td class="vert-align">
{% if post.url %}
<h4 id="line">
<img src="{{post.image}}" height="85" width="85"/><span id="title-font">{{ post.title }}</span>
<span style="margin-left: 15px;" class="domain">({{ post.domain }})</span>
<span class="discuss" style="color:red;">토론장 입장</span>
<br />
<span class="post-info">{{ post.pub_date | timesince }}전/{{ post.moderator.username }}작성/<i class="fa fa-eye"></i>{{post.views}}/{{post.category}}</span>
</h4>
{% else %}
<h4>{{ post.title }}<span style="margin-left: 15px; "class="domain">({{ post.domain }})</span></h4>
{% endif %}
For controlling "cellpadding" in CSS, you can simply use padding on table cells. E.g. for 10px of "cellpadding":
td {
padding: 10px;
}
For "cellspacing", you can apply the border-spacing CSS property to your table. E.g. for 10px of "cellspacing":
table {
border-spacing: 10px;
border-collapse: separate;
}
This property will even allow separate horizontal and vertical spacing, something you couldn't do with old-school "cellspacing".

How to stop the HTML/CSS from splitting a line of text in half between pages for print?

Would anyone know why this is happening and how to stop it from happening?
I am currently styling a .css file for print only and for the life of me have no idea how to fix this line splitting.
Here's an image of the problem:
This is built with AngularJS and this content is being pulled in/by this partial:
<div class="row">
<div class="columns">
<a ng-href="#/education" class="backLink"><span>◀</span> BACK </a>
</div>
<div class="small-12 medium-4 large-4 columns">
<div sec-menu></div>
</div>
<div class="small-12 medium-8 large-8 columns">
<div class="learning">
Print
<div ng-repeat="section in module.sections | filter:{'number': module.path.section}">
<h3>PART {{ section.number | number:0 }}: <strong>{{ section.name | uppercase }}</strong></h3>
<div ng-repeat="subSection in section.subSections | filter:{'number':module.path.subsection}">
<h4>{{ subSection.name | uppercase}}</h4>
<hr>
<div class="subSection">
<div ng-repeat="content in subSection.content" class="subSection_content">
<p ng-if="content.type =='p'" ng-bind-html="content.content" class="{{content.class}}"></p>
<img ng-if="content.type =='img'" ng-src="{{ content.url }}" alt="{{ content.content }}" class="{{content.class}}"/>
<div ng-if="content.type =='vid'" class="flex-video widescreen vimeo">
<div youtube-directive code="content.url"></div>
</div>
<h1 ng-if="content.type =='h1'" ng-bind-html="content.content"></h1>
<ol ng-if="content.type == 'ol_li'" class="{{content.class}}">
<li ng-repeat="li in content.content track by $index" ng-bind-html="li.item" style=""></li>
</ol>
<ul ng-if="content.type == 'ul_li'" class="{{content.class}}">
<li ng-repeat="li in content.content track by $index" ng-bind-html="li.item"></li>
</ul>
<ul ng-if="content.type == 'ul_img'" class="ul_img">
<li ng-repeat="li in content.content track by $index" class="{{content.class}}" ng-bind-html="li.item"></li><div class="clearBoth"></div>
</ul>
<dl ng-if="content.type == 'dd'">
<dd ng-repeat="dd in content.content track by $index" ng-bind-html="dd.item"></dd>
</dl>
<a ng-if="content.type == 'a'" ng-href="{{ content.url }}" class="{{content.class}}" ng-bind-html="content.content"></a>
<h3 ng-if="content.type == 'h3'" ng-href="{{ content.url }}" class="{{content.class}}" ng-bind-html="content.content"></h3>
<h5 ng-if="content.type == 'h5'" ng-href="{{ content.content }}" ng-bind-html="content.content"></h5>
<table ng-if="content.type == 'table'" class="{{content.class}}">
<caption>{{content.caption}}</caption>
<thead>
<tr>
<th ng-repeat="th in content.th">{{th.item}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tbody in content.tbody">
<td ng-repeat="tr in tbody.td" ng-bind-html="tr.item"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="QuizContainer"></div>
<div ng-repeat="question in module.questions | filter:{'number':module.path.subsection}" class="questionContainer" ng-class="{{question.class}}">
<div id="wrongAnswerImg">
<img class="wrongAnswerImg" ng-show="question.selectedAnswer.answerKey == 'false' && isValidated" style="width: 14px;" src=".../../img/icons/false.png" alt="an icon that shows a wrong answer" />
</div>
<div id="label">
<label ng-bind-html="question.title"></label>
</div>
<div ng-repeat="answer in question.answers">
<input type="radio"
name="{{ question.title }}"
ng-value="answer"
ng-model="question.selectedAnswer">
<div class="question-box">{{ answer.answerLabel }}</div>
<div class="{{ quizModel }}" ng-click="seeModel(module, section, subsection, question, quizModel)"></div>
<div class="clearBoth"></div>
</div>
</div>
<button ng-if="subSection.sectionType == 'quiz'" ng-click="validate()" id="submitQuiz">Submit</button>
<div ng-show="showResultLow() && hideRetry()" class="resultMessage">
<p ng-show="showResultLow()"><span>{{ correctAnswers }}%</span> of your answers were correct. Please try again.</p>
<button id="retryQuiz" ng-show="hideRetry()" onclick="location.reload(true);">Retry Quiz</button>
</div>
<div ng-show="showResultHigh() && getCertificate" class="resultMessage">
<p ng-show="showResultHigh()"><span>{{ correctAnswers }}%</span> of your answers were correct! Would you like to print a certificate?</p>
<label>Full Name</label>
<input ng-model="module.submitter" type="text" name="name" id="name" required />
<button id="printCertificate" ng-show="getCertificate()" ng-click="pdfMaker()">Print Certificate</button>
</div>
</div>
<button ng-click="goToPrevPage()" ng-hide="firstPrevBtn" class="previousBtn"><span>◀</span> Prev</button>
<button ng-click="goToNextPage()" ng-hide="lastNextBtn" class="nextBtn">Next <span>▶</span></button>
</div>
</div>
</div>
</div>
</div>
Also the content that is being printed in the .subSection div.
Put this inside your CSS for print
#media print {
div {
break-inside: avoid;
}
}
The break-inside CSS property adjusts page breaks inside the current element.
Note: page-break-inside is deprecated, but might also be necessary in some cases.
I have to imagine what is doing this is a containing div being set to display: inline-block.
If you change this to display: block you should stop this behaviour.
It's difficult to work this out without seeing the HTML, but you could have a look into the overflow property:
overflow:visible;
I had the same issue -- I was able to solve it by setting a body selector in my print media query and setting margin to 0%.
#media print {
body {
margin: 0%;
}
/* ... #page, orphans & widows, the rest of your print css ... */
}
yep.. another hour gone.