Jump to content

Neatly align items (not using table)

FaiL___

I have a series of essential key-value pairs to display on a webpage, e.g.

Name: John Smith

Description: Some description

 

and what I want is to have the value of the pairs be aligned, e.g.

Name:          John Smith

Description: Some description

 

Is there anyway to do this without a table?

 

Cheers in advance

There are 10 types of people in the world. Those that understand binary and those that don't.

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, Mira Yurizaki said:

Use a table, that's what it's used for.

 

Exactly this, why reinvent the wheel.

 

However if you under no circumstance can use tables, you can achieve the same by using DIVs and align those via CSS with display: grid. But I honestly can't imagine a reason not to use tables here.

 

But be aware, achieving table like behaviors with CSS is really tedious.  

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×