Adjust the height of the table rows to match the height of the characters

Looking to create a unique ascii chart using an old-school <table> as the canvas? Check out the striped design below:

https://i.sstatic.net/bE2m6.png

How can you move from left to right seamlessly on this table display? To achieve the optical illusion effect, ensure that the height of each table row matches the height of the characters to eliminate visible vertical spacing.

Tried adjusting CSS styles without success? Here's one example (provides the left result):

  <table class="table-responsive table-condensed table-striped table-collapse">
    <tr>
    <td class='row-mini'><div class='div-mini'><code>______┌🕖 </code></div></td></tr>
    <tr>
    <td class='row-mini'><div class='div-mini'><code>______│</code></div></td></tr>
    <tr>
    <td class='row-mini'><div class='div-mini'><code>____┌─┤</code></div></td></tr>
    <tr>
    <td class='row-mini'><div class='div-mini'><code>____│ ⋮</code></div></td></tr>
    </table>

Don't forget to apply these CSS properties:

.row-mini {
    padding:0px; margin:0;
}
.div-mini {
   height: 10 px; 
   overflow: hidden;
}

Answer №1

you can utilize line-height without any border spacing and eliminate the table-condensed class

Example

http://jsfiddle.net/81wu4cp8/

Html

 <table class="table-responsive table-striped table-collapse">
    <tr>
    <td class='row-mini'><div class='div-mini'><code>______┌🕖 </code></div></td></tr>
    <tr>
    <td class='row-mini'><div class='div-mini'><code>______│</code></div></td></tr>
    <tr>
    <td class='row-mini'><div class='div-mini'><code>____┌─┤</code></div></td></tr>
    <tr>
    <td class='row-mini'><div class='div-mini'><code>____│ ⋮</code></div></td></tr>
    </table>

Css

.row-mini {
    padding:0px; margin:0;
}
.div-mini {
   line-height: 11px; 
   overflow: hidden;
}
table {
  border-spacing: 0px;
}

Result

https://i.sstatic.net/n2wPw.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize flexbox for text wrapping while preserving the proportionate column width for varying text lengths

I'm currently working on a Wordpress site, incorporating flexbox into my design. I have set up two columns where child 1 should occupy 75% of the page width and child 2 should take up 25%. However, I've noticed that when the content in child 1 is ...

Simple Selection Panel

Looking to include a simple dropdown menu with 5 choices. Once a selection is made, an answer corresponding to that choice will appear in another field next to it. For example: Choosing France from the dropdown would display 'Paris' in the adjac ...

How can I use the store command to retrieve the href value of a link using a css selector in Selenium?

Is there a way to store a URL from a link using CSS instead of xpath? store //tr[td[contains(.,'6 Day')]][1]/td[8]/a@href my_var open $my_var If so, how can I achieve this goal with css? I managed to use the following locator: store css= ...

Is the jQuery .change event not triggering when new rows are added to a table?

Currently, I am working on a project in asp.NET. The code-behind page is bound to a repeater control that populates a table on the webpage. To maintain a clean look, I have hidden the table using CSS when it is empty. Now, my goal is to use jQuery to show ...

What is the best way to align two navigational bars?

I'm experiencing some difficulty with positioning a second navigation bar in my Adobe XD design. View the Adobe XD design here My attempts to use the float element have resulted in an overlap with the background image for the hero section. Here is h ...

When using NVDA (Accessibility Screen Reader) on Google Chrome, chances are that the text in a Bootstrap Modal Dialog may not be

To Test Accessibility: Click here for the NVDA Screen Reader test For 508/accessibility compliance, I am running tests using the NVDA Screen Reader. Currently, I have implemented "Info Dialog" boxes through Bootstrap Modal. While Firefox correctly reads ...

Ways to center h2 in a nested div

Having trouble aligning the text within my h2 element vertically in a div. Using .NET MVC. Here is the HTML that's causing issues: .banner-side-container { height: 240px; width: 180px; vertical-align: middle; } .banner-side-container h2 { ...

Is it possible to use CSS to create a fading effect on the edges of a div

I am looking to implement a mobile modal popup that will show a success message. Currently, I am working to add a semi-transparent overlay to the entire screen using this CSS: .overlay { position:fixed; top:0px; left:0px; width:100%; h ...

The dropdown menu in the navigation bar is not properly lined up with its corresponding menu item

I've been struggling to align my submenu with the navbar, and I suspect there is an issue with the CSS that I can't seem to figure out. CodePEN: https://codepen.io/wowasdi/pen/xxKzdQq Even after trying to adjust the navbar CSS settings by changi ...

How to upload several files with identical file names using dropzone.js

I've been using dropzone.js with great success, but I ran into an issue when trying to upload multiple files with the same name. For example, uploading photos from an iOS device where they all have the name "image.jpg." While I can change the file nam ...

Unable to update the color of material icon using document.getElementById(item) method

if (document.getElementById(item).style.color == "grey") { document.getElementById(item).style.color = "red"; } <i class="material-icons" [ngStyle]="post.isLiked != null ? {'color': 'red'}: {'color': 'grey'}" id ...

Issue with if statement when checking element.checked

Hey everyone, I'm currently working on a calculator app and running into an issue. I have set up 3 radio buttons and I would like to check them using an 'if statement' in my JS file. However, the problem is that the 'main' element ...

Enhancing the layout of a bootstrap table: Creating space between rows while maintaining borders

table{ width: 100%;max-width: 100%; margin-bottom: 20px;border:solid 1px #000; border-collapse: collapse;} tbody tr{border:2px solid #256ac4;} td{ color: #8d9097; vertical-align: top; font-size: 14px;} th{text-align:left} <table> <thead> ...

How can we effectively present a list of items with separators using templating?

I have an array filled with data that I want to showcase as a list: $products = [ ['name' => 'Product A', 'info' => 'Description of Product A'], ['name' => 'Product B', 'inf ...

The JQuery command to set the display property to "block" is not functioning as expected

When trying to toggle the visibility of my TextBox based on a selected value in a RadiobuttonList, I initially wrote the following code: $("#<%= rbtnIsPFEnabled.ClientID %>").click(function () { pfno = $("#<%= txtPFNo.ClientID %&g ...

What does the term "the selected font size" mean when defined in em units?

Exploring the query raised in this post: Why em instead of px?, the top voted response sheds light on the nature of em: The unit 'em' is not fixed but rather relative to the current font size. It varies according to the user's chosen font p ...

Showing different HTML elements based on the link that is clicked

Recently, I delved into the world of web development and decided to test my skills by creating a basic webpage with an interactive top navigation bar. Depending on the link clicked, specific HTML elements would be displayed while turning off others using a ...

What is the best way to ensure a grid element has a column designated for each of its children?

Imagine this HTML structure: /* Desired styling: */ .container { display: grid; grid-template-columns: 250px 250px 250px /* this is the part to automate */ grid-template-rows: 50px; } .child { width: 100%; height: 100%; background: ...

Is there a way to retrieve the initial value from the second element within the JSON data?

Exploring JSON Data Collections In my JSON data, I have two collections: FailedCount and SucceededCount. { "FailedCount": [{ "FailedCount_DATE_CURRENT_CHECK": "2016-11-30 10:40:09.0", "FailedCount_DATE__CURRENT__CHECK": "10:40:09", "FailedCo ...

"Spice up your website with dynamic text colors using JQuery

REVISED I've been exploring various options and attempting to create a solution, but I'm struggling with it... Do you think it's feasible to achieve this? <button>Button</button> <div id='myDivId'> ...