Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9195197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:34:37+00:00 2026-06-17T21:34:37+00:00

In HTML/CSS I want to display a data-tree in the following form: The root

  • 0

In HTML/CSS I want to display a data-tree in the following form:
The root node is on the left side. Parent nodes are to the left of child nodes and the first child is always on the same line as the parent. The sibling nodes are on the lines below.

See this example. The lines are just illustrative here to understand the relationships.

1 - 1.1 - 1.1.1
  \     ` 1.1.2
   `1.2 - 1.2.1
2 - 2.1
   `2.2

I want to have the child nodes connected with their parents so that, when I e.g. drag-drop the parents, all the connected child nodes move too. Thats why I chose a nested-approach.

My approach:

<div><p> some text </p><div> recursively add the children here </div></div>

Each node I add like this

$(document.createElement('div'))
    .appendTo(parent)
    .css('overflow', 'auto')
    .append($(document.createElement('p'))
        .css('float', 'left')
        .html(some text)
    .append($(document.createElement('div'))
        .css('overflow', 'auto'));

My problem with the approach:
When the tree gets larger than the container it wraps to the next line. However I want the effect of overflow:hidden. This css tag on the container has no effect with left-floating items.

jsFiddle:
See this jsFiddle for an example: http://jsfiddle.net/Afasv/8/
The first one is what the tree looks like in a too tight container, the second it has enough space and in the third I am using a hack where I place the tree within a div larger than the outer container.

Any ideas for a solution would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:34:39+00:00Added an answer on June 17, 2026 at 9:34 pm

    As well as the others who commented I am not exactly sure what your problem is. My guess is that you are looking for display: inline-block and white-space: nowrap. That way the list only has linebreaks where you want them to be, regardless of available space.

    If you really want overflow: hidden you can still add it to the first-level ol. Although hiding content most of the time isn’t in the best interest of the user. (overflow: auto perhaps?)

    http://jsfiddle.net/QGkKD/1/

    And you really should use lists to mark up lists.

    One more thing. If you have a problem with HTML and CSS, there is really no use in showing any Javascript-Code. It just conceals the actual problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to format the data display HTML below using CSS. I want the
I want to integrate a full HTML framework (ie HTML/CSS/JavaScript) inside an iOS app
I'm using this HTML,CSS and Javascript code (in one document together if you want
Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the
I want to achieve this using html and css: I have tried to set
I want to create a non-stop spinning square using html and css. I currently
I have a html + css + javascript application. I want to be able
I was wondering if there is any CSS/HTML/JavaScript magic to do what I want
I am trying to build a resume with pure HTML and CSS, and want
this is HTML <p>x1</p> <p>x2</p> and i want css to select first < p>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.