HTML table cell size not right when cell is empty
up vote
0
down vote
favorite
I am wanting a consistent size for my table cells. I am having a problem when a cell is empty. It looks like this:
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
{% for description, url_value in zip(pushPinDescription, url) %}
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
{% endfor %}
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
{% for title in corkboardTitle %}
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
{% endfor %}
</th>
</tr>
<tr>
</table>
However, when the value in description is filled. all of the boxes align correctly. How can I make it so that the boxes are all aligned, even if the description is empty?
html
add a comment |
up vote
0
down vote
favorite
I am wanting a consistent size for my table cells. I am having a problem when a cell is empty. It looks like this:
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
{% for description, url_value in zip(pushPinDescription, url) %}
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
{% endfor %}
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
{% for title in corkboardTitle %}
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
{% endfor %}
</th>
</tr>
<tr>
</table>
However, when the value in description is filled. all of the boxes align correctly. How can I make it so that the boxes are all aligned, even if the description is empty?
html
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am wanting a consistent size for my table cells. I am having a problem when a cell is empty. It looks like this:
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
{% for description, url_value in zip(pushPinDescription, url) %}
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
{% endfor %}
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
{% for title in corkboardTitle %}
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
{% endfor %}
</th>
</tr>
<tr>
</table>
However, when the value in description is filled. all of the boxes align correctly. How can I make it so that the boxes are all aligned, even if the description is empty?
html
I am wanting a consistent size for my table cells. I am having a problem when a cell is empty. It looks like this:
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
{% for description, url_value in zip(pushPinDescription, url) %}
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
{% endfor %}
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
{% for title in corkboardTitle %}
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
{% endfor %}
</th>
</tr>
<tr>
</table>
However, when the value in description is filled. all of the boxes align correctly. How can I make it so that the boxes are all aligned, even if the description is empty?
html
html
asked Nov 20 at 4:05
Jay266
492315
492315
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You need to add for empty cell or you can add
.list-group-item {
min-height: 50px;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table>add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You need to add for empty cell or you can add
.list-group-item {
min-height: 50px;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table>add a comment |
up vote
0
down vote
You need to add for empty cell or you can add
.list-group-item {
min-height: 50px;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table>add a comment |
up vote
0
down vote
up vote
0
down vote
You need to add for empty cell or you can add
.list-group-item {
min-height: 50px;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table>You need to add for empty cell or you can add
.list-group-item {
min-height: 50px;
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table> <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table> <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"/>
<table style="width:100%" class="fixed">
<tr>
<th>
<h4><u><b>PushPin Description</b></u></h4>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b> </b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
<li class="list-group-item"><font size="2"><a href={{url_value}}><b>{{description}}</b></a></font> </li>
</th>
<th>
<h4><u><b>Corkboard</b></u></h4>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
<li class="list-group-item"><font size="2"><b>{{title}}</b></font> </li>
</th>
</tr>
<tr>
</table>answered Nov 20 at 4:13
Hiren Vaghasiya
2,4941419
2,4941419
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53386062%2fhtml-table-cell-size-not-right-when-cell-is-empty%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown